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?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here