Question: Add code to the main method of your project that does the following: Output a statement that says Hello from [your first and last name].
Add code to the main method of your project that does the following:
Output a statement that says Hello from [your first and last name].
Declare an integer variable num1 and assign it the value 3.
Declare an integer variable num2 and assign it the value 10.
Declare an integer variable sum and assign it the sum of num1 plus num2.
Output the values in this format. Be sure to use the variables, not literals, in your code:
The sum of 3 and 10 is 13.
Declare a double variable value1 and assign it the value 32.4.
Declare a double variable value2 and assign it the value 17.8.
Declare a double variable product and assign it the product of value1 times value2.
Output the values in this format. Be sure to use the variables, not literals, in your code:
The product of 32.4 and 17.8 is xxx.xx
where xxx.xx is the calculated product.
Note that the values should be displayed with 1 place to the right of the decimal, and the product should be displayed with 2 places to the right of the decimal.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
