lab06 - 1.15 Neptune 1.12 Include appropriate error...

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern