1. Is the following valid, given the class SavingsAccount in Listing 6.7? SavingsAccount.addInterest(); 2. What values are returned by each of the following? a. Math.round(2.3) b. Math.round(2.7) c....


1. Is the following valid, given the class SavingsAccount in Listing 6.7?


SavingsAccount.addInterest();


2. What values are returned by each of the following?


a. Math.round(2.3)


b. Math.round(2.7)


c. Math.floor(2.3)


d. Math.floor(2.7)


e. Math.ceil(2.3)


f. Math.ceil(2.7)


g. (int) (Math.random() * 10.0) + 10;


3. Suppose that speed is a variable of type double and you want to assign


Math.round(speed) to the variable approxSpeed, which is of type int.


How do you write the assignment statement?



Nov 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here