Calculate and display the weight of the object on that body

Assignment Help Programming Languages
Reference no: EM131105716

Programming Assignment

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

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

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.

Sample calculation sheet: In addition to your program and output, attach a page showing your sample calculation. These sample calculations should be done before you start programming and used as a minimal set of test cases for your program.

Part -2:

Objective Become familiar with the C++ compiler/environment that you plan to use for the programming assignments in this class. I strongly recommend using the Unix system as we discussed in class.

Requirements:

- Get the "Hello, world!" program working.
- Add a function (ShowProgramHeader 0 as described in lecture) to print your name and class information before the "Hello, world!" message.

Note: This will be required on all future assignments.

The following changes should generate compiler errors/warnings. If it does, record the message; if it does not, record that. 'Dim this record in with your assignment.

- Remove the semi-colon from the output statement in main().
- Comment out the using namespace std; statement. Use either a block comment or an in-line comment. Is there a difference?
- Comment out the #include Costream> (#include <iostream h> on older compilers) statement. Use either a block comment or an in-line
comment. Is there a difference?
- Change the double quotes that enclose the Hello, world! message to single quotes.
- Change the << (put to operator) to < on one of your output lines.
- Remove the starting brace from main().
- Remove the closing brace from main0.
- Change tout to Gout or COUT.
- Change main to Main or MAIN.

Change the name of the function that displays your name, date, etc, from ShowProgramHeader() to ShowHeader().

Deliverables

Program-fully documented.

Output-neatly formatted and documented.

List of errors-neatly formatted

 

Reference no: EM131105716

Questions Cloud

Resulting strategic responses to new stage : The U.S. Healthcare system is currently in a stage where consumer choices are re-shaping health care. What are the resulting strategic responses to this new stage? Do you work for an organization that is responding in any of these ways? Explain..
Analyze the potential benefit that a flat tax structure have : Analyze the potential benefits that a flat tax structure might have on both taxpayers and the United States Treasury. Defend or critique a flat tax structure.
The natural length of a spring : The natural length of a spring is 8.0 cm. A force of 12 N stretches it to a length of 10.0 cm. How much work is done in stretching it from a length of 10.0 cm to a length of 14.0 cm?
Eliminate shortages and stock outs : Why would not a company always store large quantities of inventory to eliminate shortages and stock outs?
Calculate and display the weight of the object on that body : Calculate and display the weight (N) of the object on that body - Objective Become familiar with the C++ compiler/environment that you plan to use for the programming assignments in this class
Does the research by art laffer have no income tax perform : Does the research by Art Laffer and other economists suggest that over time states that have no income tax perform better than states with high-income taxes? Why? Does a flat tax make more sense from a taxation standpoint?
Key opportunities and threats in external environment : In Module 2, we focus on SWOT. In order to complete a SWOT, we are required to identify and analyze the key opportunities and threats in the external environment. Then, we need to identify and analyze the company's key strengths and weaknesses (in..
Explain how law and ethics are different : Explain how both individuals and institutions can be viewed as ethical or unethical. Give an example of each. Explain how law and ethics are different, and why a good reputation can be more important than legal compliance.
Hobart beverage company uses the weighted-average : Hobart Beverage Company uses the weighted-average method in its process costing system. Materials are included at the start of the production process but conversion costs are uniformly applied throughout the production process.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd