CS 107 - Summer 2015

Programming Project 1

Due: Tuesday 6/30/15 at 11:59pm

I Weigh What Where???

Write a "C+" program were the user will enter his/her weight and the name of a planet. The program is to output the amount that person would weigh on that planet. The following table give the factor by which the weight must be multiplied for each planet.

Planet Weight Factor
Mercury 0.4155
Venus 0.8975
Earth 1.0
Moon 0.166
Mars 0.3507
Jupiter 2.5374
Saturn 1.0677
Uranus 0.8947
Neptune 1.17794
Pluto 0.0899

The program is to give an error message if the user doesn't type in a correct planet name or if the user give a negative weight amount. The planet name will expect the first letter to be capitalized, but the rest of the letters to be lower case.

Your program is to prompt the user for the input. One prompt for the weight amount and a second prompt for the palnet name.

All output and prompts must be decriptive and neatly formatted.

Your code must be properly formatted and appropriately commented. These items should include:

  • meaningful variable names
  • use of aligned indentation
  • use of blank lines
  • in-line commenting
  • block commenting at the beginning of the program
You are to submit the code electronically through UIC Blackboard.
Topic revision: r1 - 2015-06-18 - 21:24:00 - Main.troy
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
Helping Women Faculty Advance
Funded by NSF