Question: Below is a list of things that your program should do and the exact order in which they should be done: Declare two integers (call

Below is a list of things that your program should do and the exact order in which they should be done:

  1. Declare two integers (call them firstNumber and secondNumber) and assign them some values of your choice (1 pt).
  2. Compute the result of dividing firstNumber by secondNumber; store it in an int variable. Display the result (2 pts).
  3. Compute the result of dividing firstNumber by secondNumber; store it in a double variable. Display the result (2 pts).
  4. Compute the result of casting firstNumber to a double, then dividing by secondNumber; store it in a double variable. Display the result (2 pts).
  5. Compute the result of dividing firstNumber by secondNumber and then casting to a double (use parentheses to force the order of operations); store it in a double variable. Display the result (2 pts).
  6. Explain the results that you observed in steps 2-5. Why did some of the answers give the correct mathematical result, and others did not? Write your explanation in the comments of the program. (2 pts).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!