Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Simple Java Type Calculations. Write a complete Java program that will do the following: 1 . Displaysawelcomemessage. 2 . Then prompts the user

Question 1 Simple Java Type Calculations. Write a complete Java program that will do the following: 1. Displaysawelcomemessage. 2. Then prompts the user to enter the following: Two integer values which are stored in two variables of type int. Two double values which are stored in two variables of type double. We assume that all the input that is entered by the user is perfect and valid. No validation for the input is needed for this assignment. 3. The program should declare a third integer variable and initialize its value to the value of the first integer divided by the value of the second integer. 4. The program should display the following message: The result of int1_Value / in2_Value is int3_Value int1_Value, int2_Value and int3_Value are replaced by their real values. 5. The program should declare a third double variable and initialize its value to the value of the first double divided by the value of the second double. 6. The program should display the following message: The result of double1_Value / double2_Value is double3_Value Double1_Value, double2_Value and double3_Value are replaced by their real values. 7. Now the program should assign the third double to the value of the first integer divided by the second double and then displays the following message: The result of int1_Value / double2_Value is double3_Value Int1_Value, double2_Value and double3_Value are replaced by their real values 8. Now the program should assign the third integer to the value of the first integer modulus the value of the second integer and then displays the following message: The result of int1_Value % in2_Value is int3_Value int1_Value, int2_Value and int3_Value are replaced by their real values. 9. Finally,theprogramshouldassignthethirdintegertothevalueofthefirstdouble divided by the second double and then displays the following message: The result of double1_Value / double2_Value is int3_Value Int1_Value, double2_Value and double3_Value are replaced by their real values. You should notice that type casting is needed here. 10.Displays a closing message. Comp248/AA-Summer 2024 Assignment 1 Page 211.You need to repeat the program three times with different set of input in each run and note your observation about the result in each run.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Calculate the missing value.

Answered: 1 week ago