## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

#### Exercises

D.7 What is the value of `x` after each of the following statements is executed?

a) `x = Math.abs(` 7.5 `);`

b) `x = Math.floor(` 7.5 `);`

c) `x = Math.abs(` 0.0 `);`

d) `x = Math.ceil(` 0.0 `);`

e) `x = Math.abs(` -6.4 `);`

f) `x = Math.ceil(` -6.4 `);`

g) `x = Math.ceil( -Math.abs(` -8 `+ Math.floor(` -5.5 `) ) );`

D.8 (Parking Charges) A parking garage charges a \$2.00 minimum fee to park for up to three hours. The garage charges an additional \$0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is \$10.00. Assume that no car parks for longer than 24 hours at a time. Write an application that calculates and displays the parking charges for each customer who parked in the garage yesterday. You should ...

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required