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

  What are all of the values of the variables

Assume the calls are not accumulative; that is, they are always called with the initialized values of the variables, so their effects are not accumulative.

  Design an instruction that useful for handling while loops

The loop instructions discussed in the text were for handling for loops. Design an instruction that might be useful for handling common while loops instead.

  Flipflapsthe project is to design and write a c 11fltk game

flipflapsthe project is to design and write a c 11fltk game program with a graphical user interface.the game is based

  Write a program that asks the user for a profile name

Write a program that asks the user for a profile name and displays the number of characters, words, and lines in that file. Then have the program ask for the name of the next file. When the user enters a file that doesn't exist (such as the empty ..

  Program that asks the user for two integers and a character

Write a program that asks the user for two integers and a character, 'A', 'S', or 'M'. Call one of three functions that adds, substracts, or multiplies the user's integers, based on the character input.

  What is encapsulation

What is encapsulation

  Create code using raptor flowchart programming

Demonstrate your analytical and problem-solving skills in analyzing a problem statement and providing your solution by developing a Raptor program that addresse

  What is the big-o run-time of the c++ function

What is the big-O run-time of the following C++ function

  Amounts of production time and paper

A publishing house publishes three weekly magazines-daily life, agriculture today, and surf's up. Publication of one issue of each of the magazines requires the following amounts of production time and paper:

  Sequence of instructions that transfers data from memory

Write a sequence of instructions that transfers data from memory to an external I/O device by using channel 3 of the 8237 DMA controller. Transfer from 20000H-20FFFH.

  Describing the definition of a constructor

To convert a value from type A to class B, the definition of should include a constructor that takes a single parameter that is of.

  What is an abstract base class

What is a pure virtual function. Why would you define a pure virtual function. Give an example of a pure virtual function. What is an abstract base class. What does it do. Why would you make a class abstract

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