Question: Chapter 4 R4.1 Write declarations for storing the following constants s. Choose between integers and floating-point numbers. Declare n appropriate a. The number of days
R4.1 Write declarations for storing the following constants s. Choose between integers and floating-point numbers. Declare n appropriate a. The number of days per week b. 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 R4.2 What is the value of mystery after this sequence of statements? int mystery1; mystery 1 . 2 * mystery; mystery mystery1; R4.3 What is wrong with the following sequence of statements? int mystery = 1; mystery -mystery1; int mystery = 1-2 * mystery; R4.4 Write the following Java expressions in mathematical notation. a. dm-m (Math.sqrt(i+c)/ Math.sqrt(1-vc) -); b. volume Math.PI * r * r * h; c. volume = 4 * Math.PI * Math. pow(r, 3) / 3; d.z = Math.sqrt (x * x + y * y); R4.5 Write the following mathematical expressions in Java. P(m+m2) YRS INT 100 cb-2abcosy R4.6 What are the values of the following expressions? In each line, assume that double x 2.5 double y =-1.5; nt n 4; e. Math.sqrt(Math.sqrt(n))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
