Display the value stored in num4 with the label the result


Question: Please make sure to follow the instructions carefully and in the subsequent order.  Remember that all variables are to be declared -- and initialized if so at the top of the main method.  int variables always come before double variables. 

Please use the precisely same character strings provided to you below in your System.out.println statements.

Declare two double constants named CONST1 and CONST2.  Initialize const1 to 7.15% and const2 to 134.55. 

Declare three integer variables named num1, num2 and num3.  Initialize num1 and num2 each to a value between 1 and 100 but make num1 larger than num2.  Do not initialize num3.

Declare one double variable named num4.  Do not initialize num4.

Divide num1 by num2 and store the result in num3.

Show the value stored in num3 with the label "The result of integer num1 divided by integer num2 and stored in an integer is ".

Divide num1 by num2 and store the result in num4.

Display the value stored in num4 with the label "The result of integer num1 divided by integer num2 and stored in a double is ".

  Divide num1 by num2 again but this time cast num1 as a double.  Store the result in num4.

Display the value stored in num4 with the label "The result of integer num1 (cast as a double) divided by integer num2 and stored in a double is ". 

Multiply CONST1 by CONST2 and store the value in num4.

Display the value stored in num4 with the label "The result of the constant const1 multiplied by the constant const2 is ". 

Use System.out.println exclusively.  Use the escape sequence \n wherever essential to put a blank line in between each of the above lines of output.

Make this program using java programming. Make this application in simple way.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Display the value stored in num4 with the label the result
Reference No:- TGS0954010

Expected delivery within 24 Hours