1. Engineering
  2. Computer Science
  3. 1 given 2 points per problem int x3 m2 h14...

Question: 1 given 2 points per problem int x3 m2 h14...

Question details

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

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution