lab06 - 1.15 Neptune 1.12 Include appropriate error...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 6: Weights on Other Planets Last Modified 01/03/2009 (Modified from Project 7-4 in Knowlton) Key concept: Switch Write a program that determines your weight on another planet given your weight on Earth. The program should ask for the user's weight on Earth and present a menu of the planets in our solar system from which to choose the other planet. The user should choose one of the planets from the menu. Use a switch statement to calculate the weight on the other planet. Use the following conversion factors for the other planets: Planet Multiply By Mercury 0.37 Venus 0.88 Mars 0.38 Jupiter 2.64 Saturn 1.15 Uranus
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1.15 Neptune 1.12 Include appropriate error handling. Sample Interaction Enter your weight in lb: 100 Select a planet to get your weight there: (M)ercury (V)enus Ma(R)s (J)upiter (S)aturn (U)ranus (N)eptune Planet choice: M Your weight on this new planet is 37.0 lb. Lab Report Needs. .. • Your code • Sample runs that demonstrate branch coverage • Discussion (Include an answer to this question: What happens without the break s?) Incidentally, the book where I found this data was published back when Pluto had planet status. If you care, Pluto's conversion factor is 0.04....
View Full Document

This document was uploaded on 02/10/2011.

Page1 / 2

lab06 - 1.15 Neptune 1.12 Include appropriate error...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online