Question: 1. Given: (2 points per problem) int x-3, m-2, h-14; long z-9; double n-15.0, y-34.2; Which of the following assignments are valid If an assignment

 1. Given: (2 points per problem) int x-3, m-2, h-14; long

1. Given: (2 points per problem) int x-3, m-2, h-14; long z-9; double n-15.0, y-34.2; Which of the following assignments are valid If an assignment is not valid state the reason. If the assignment is valid show the result of the calculation. NOTE assume that the effect of these assignment statements are NOT accumulative. (4 points each, 20 total) a. m (int)17.5 * 2+h%3; c. x=4*2/3-(5 * h) % 4; 2. Suppose x, y, z, and w are int variables. What value is assigned to each variable after the last statement executes? Assume the effects of the expressions are cumulative. (4 points each problem, 20 total) int w-5, y-3,z^ -4, x-2; x*-(2 * w) % 3; w=++x * 2 * y + z++; a. b. 3. Translate the following equation into a valid JAVA expression. (5 points) This is the equation to calculate compound interest. HOWEVER, just assume that the variables have been declared as follows double A, P, r, n, t; Also assume that they contain some valid value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!