On pages 71-73 of Big Java: Late Objects, complete the following Review Exercises:
- R2.1 Write declarations for storing the following quantities. Choose between integers and floating-point numbers. Declare constants when appropriate.
a. The number of days per weekb. The number of days until the end of the semester
c. The number of centimeters in an inch
d. The height of the tallest person in your class, in centimeters
- R2.2 What is the value of mystery after this sequence of statements?
int mystery = 1;
mystery = 1 – 2 * mystery;
mystery = mystery + 1;
- R2.3 What is wrong with the following sequence of statements?
int mystery = 1;
mystery = mystery + 1;
int mystery = 1 – 2 * mystery;
- R2.4 Write the following mathematical expressions in Java.
Solution:
Looking for help with your homework?
Grab a 30% Discount and Get your paper done!
30% OFF
Turnitin Report
Formatting
Title Page
Citation
Place an Order