Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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 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

 

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91859101
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As