Question

2. Write a Java code to complete the following operations: (1) Define a double variable var 1, initialize it with value 9.99 (2) Given two integer variables var2 and var3,

write a statement that gives var3 a value that is 4 more than the value of var2. (3) Define a double variable var4, initialize it with value 1234.56. Write a statement to change var4 so it will just hold one third (1/3) of the original value (4) Given four doble variables var5, var6, var7, var8. Define the fifth variable var9 which will be initialized with value that is 1/2 * var5 + 1/3 * var6 + 1/4 * var7 +1/5 * var8

Question image 1Question image 2Question image 3Question image 4Question image 5