Write a program that calculates the weight of an object on


Objective: Become more familiar with C++ I/O, computations in C++, and the C++ development environment you are using for this class.

Description: Write a program that calculates the weight of an object on the Earth, Moon, and Mars. Specifically, your final program will choose from a menu to determine the gravity (m/s2) an object is on, then will read the mass of the object (kg), then calculate and display the weight (N) of the object on that body.

Useful information:

W = mg

Body

g (m/s2)

Earth

9.81

Moon

1.63

Mars

3.71

Outline of solution:

1. Display standard output information using the ShowProgramHeader 0 function to print your required output information. (Remember to call the ShowProgramHeader() function from from your main function.)

2. Display body choice menu.

3. Prompt user for body (input).

4. Read body choice (a number is probably easiest).

5. Prompt user for the mass of the object (input).

6. Read the mass.

7. Calculate the weight (body dependent).

8. Print input values and mass (show all units).

Deliverables:

  • Program-fully documented.
  • Output:

- Show intermediate steps in the development of your program.

- Test your final program using at least three different values for the mass: 10, 50, and 250 kg.

If you have any questions regarding this assignment, do not hesitate to contact me. Start working on this assignment as soon as possible, so that you have plenty of time to get help if you need it.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program that calculates the weight of an object on
Reference No:- TGS01031879

Now Priced at $40 (50% Discount)

Recommended (97%)

Rated (4.9/5)