How much the user would weigh on that planet

Assignment Help C/C++ Programming
Reference no: EM132432147

ASSIGNMENT (ARRAYS)

Use functional decomposition to a C++ program that asks the user to enter his or her weight and the name of a planet. Use an enumerated type called planetType to represent the planets and use a switch statement that takes as its condition a planetType variable. The program, via the switch statement, then outputs how much the user would weigh on that planet. The following table gives the factor by which the weight must be multiplied for each planet.

The program must have the following functions in it: GetUserInput(), ConvertInputToPlanetType(), and OutputWeight() (your switch statement must be in OutputWeight()). I will let you determine what each function's parameters and return types should be. The program will output an error message if the user does not have correct planet name. The prompt and the error message will make it clear to the user how a planet name must be entered.

Use proper formatting and appropriate comments in your code. The output must be labeled clearly and formatted neatly.

The following table gives the factor by which the weight must be multiplied for each planet:

Mercury 0.4155

Venus 0.8975

Earth 1.0

Moon 0.166

Mars 0.3507

Juoiter 2.5374

Saturn 1.0677

Uranus 0.8947

Neptune 1.1794

Pluto 0.0899

Reference no: EM132432147

Questions Cloud

Special discounts for students and pensioners : NuMetro has a special on movies for all members of the public but special discounts for students and pensioners. If pensioners or students buy a movie ticket
Grade for an assignment as a percentage : The program that computes a student's grade for an assignment as a percentage given the student's score and total points. The final score must be rounded up
Record the transactions in Speedy Transport Ltds journal : Speedy has a separate accumulated depreciation account for each of these assets except Land. Record the transactions in Speedy Transport Ltd.'s journal
Graphic Display Of Sociological Theories Assignment : Graphic Display Of Sociological Theories Assignment help and solutions:- illustrate the relationship between the foundational sociological theories
How much the user would weigh on that planet : The program, via the switch statement, then outputs how much the user would weigh on that planet.
Explain how this impacted your perception of business : Have you witnessed unethical practices in workplace? If so, please share your experience with class and explain how this impacted your perception of business.
Develop the program using functional decomposition : Develop the program using functional decomposition, and use proper style and documentation in your code. Your program must make appropriate use
Socialization and Social Structure Assignment : Socialization and Social Structure Assignment help and solutions:-Different societies have different social structures. What is social structure?
Describe economic trade off faced by the Fed : Describe an economic trade off faced by the Fed in achieving its economic policy objectives. Why might the Fed's monetary policy depend on the fiscal policy.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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