Building Java Programs: A Back To Basics Approach (5th Edition)
Building Java Programs: A Back To Basics Approach (5th Edition)
5th Edition
ISBN: 9780135471944
Author: Stuart Reges, Marty Stepp
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 3.2, Problem 13SCP

a.

Explanation of Solution

Result of “Math.abs(-1.6)”:

  • To find the absolute value of a number, the function “Math.abs()”is used.
  • The absolute value of “-1...

b.

Explanation of Solution

Result of “Math.abs(2 + -4)”:

  • To find the absolute value of a number, the function “Math.abs()”is used.
  • First, the result of the expression “2+ -4” is calculated as “-2”...

c.

Explanation of Solution

Result of “Math.pow(6,2)”:

  • “Math.pow()” is an inbuilt function of Java and is used to give the value of first argument raised to the power of second argument...

d.

Explanation of Solution

Result of “Math.pow(5/2 , 6)”:

  • “Math.pow()” is an inbuilt function of Java and is used to give the value of first argument raised to the power of second argument.
  • The value of “5/2”is “2” and the v...

e.

Explanation of Solution

Result of “Math.ceil(9.1)”:

  • “Math.ceil()” is an inbuilt function of Java and is used to give the double value, which is greater than or equal to the value passed as an argument...

f.

Explanation of Solution

Result of “Math.ceil(115.8)”:

  • “Math.ceil()” is an inbuilt function of Java and is used to give the double value, which is greater than or equal to the value passed as an argument...

g.

Explanation of Solution

Result of “Math.max(7,4)”:

  • “Math.max()” is an inbuilt function of Java used to give the larger of the two numbers...

h.

Explanation of Solution

Result of “Math.min(8,3+2)”:

  • “Math.min()” is an inbuilt function of Java used to give the smaller of the two numbers.
  • The expression “3+2” is evaluat...

i.

Explanation of Solution

Result of “Math.min(-2,-5)”:

  • “Math.min()” is an inbuilt function of Java used to give the smaller of the two numbers...

j.

Explanation of Solution

Result of “Math.sqrt(64)”:

  • “Math.sqrt()” is an inbuilt function of Java used to give the positive square root of the double value.
  • The square root of the value “64” is “8”...

k.

Explanation of Solution

Result of “Math.sqrt(76+45)”:

  • “Math.sqrt()” is an inbuilt function of Java used to give the positive square root of the double value.
  • First, the expression “76+45” is evaluated to “121”...

l.

Explanation of Solution

Result of “100+Math.log10(100)”:

  • “Math.log10()” is an inbuilt function of Java used to give the base “10” logarithm of double value.
  • The base “10” logarithm of “100” is “2” and the expression “Math...

m.

Explanation of Solution

Result of “13+ Math.abs(-7) – Math.pow(2,3) +5”:

  • To find the absolute value of a number, the function “Math.abs()”is used.
  • The expression “Math.abs(-7)” returns the value “7”.
  • “Math.pow()” is an inbuilt function of Java and is used to give the value of first argument raised to the power of second argument.
  • In the expression “Math...

n.

Explanation of Solution

Result of “Math.sqrt(16) * Math.max(Math.abs(-5),Math.abs(-3))”:

  • To find the absolute value of a number, the function “Math.abs()”is used.
  • “Math.sqrt()” is an inbuilt function of Java used to give the positive square root of the double value.
  • “Math.max()” is an inbuilt function of Java used to give the larger of the two numbers.
  • The expression “Math.abs(-5)” returns the value of “5” and the expression “Math.abs(-3)” returns the value “3”.
  • The largest of the value “5” and “3” is returned by the expression “Math...

o.

Explanation of Solution

Result of “7-2+Math.log10(1000)+Math.log(Math.pow(Math.E, 5))”:    

  • “Math.log10()” is an inbuilt function of Java used to give the base “e” logarithm of double value.
  • Math...

p.

Explanation of Solution

Result of “Math . max(18-5, Math.ceil(4.6 * 3))”:    

  • “Math.max()” is an inbuilt function of Java used to give the larger of the two numbers.
  • “Math.ceil()” is an inbuilt function of Java and is used to give the double value, which is greater than or equal to the value passed as an argument.
  • The expression “18-5” is evaluated to “13” and the expression “4...

Blurred answer

Chapter 3 Solutions

Building Java Programs: A Back To Basics Approach (5th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY