Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. //Made by Devin
  2. //ICL 02-01
  3. //This program will determine the user's weight on another planet. Once asking for their weight on Earth, it will present them with a list of the planets in our solar system. They have to pick one of the planets, and then once they choose one the program will calculate their weight on that planet, and output it.
  4.  
  5. #include <cstdlib>
  6. #include <iostream>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11.  
  12. {
  13.  
  14. float EarthWeight; //variables
  15. int PlanetChosen; //variables
  16. float ConvertedWeight; //variables
  17.  
  18. cout << "Welcome to Devin's planet program! Once you enter your weight on Earth \nyou will be asked to select a planet in our solar system. Once you select the \nplanet, it will convert your weight on Earth to what it would be on the planet \nyou selected, and output the results.\n";
  19.  
  20. cout << "\nWhat is your weight on Earth?\n";
  21. cin >> EarthWeight;
  22.  
  23. cout << "\nThanks! Now pick a planet from the list below. Enter the number that displays \nbefore the planet. For example if you would enter a 3, it would pick mars, \nas there is a ""3"" before mars.\n\n";
  24.  
  25. cout << "1. Mercury\n";
  26. cout << "2. Venus\n";
  27. cout << "3. Mars\n";
  28. cout << "4. Jupiter\n";
  29. cout << "5. Saturn\n";
  30. cout << "6. Uranus\n";
  31. cout << "7. Neptune\n\n";
  32. cin >> PlanetChosen;
  33.  
  34.  
  35. if(PlanetChosen == 1)
  36. {
  37. ConvertedWeight = EarthWeight * 0.37;
  38. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Mercury.\n";
  39. }
  40.  
  41. if(PlanetChosen == 2)
  42. {
  43. ConvertedWeight = EarthWeight * 0.88;
  44. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Venus.\n";
  45. }
  46.  
  47. if(PlanetChosen == 3)
  48. {
  49. ConvertedWeight = EarthWeight * 0.38;
  50. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Venus.\n";
  51. }
  52.  
  53. if(PlanetChosen == 4)
  54. {
  55. ConvertedWeight = EarthWeight * 2.64;
  56. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Jupiter.\n";
  57. }
  58.  
  59. if(PlanetChosen == 5)
  60. {
  61. ConvertedWeight = EarthWeight * 1.15;
  62. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Saturn.\n";
  63. }
  64.  
  65. if(PlanetChosen == 6)
  66. {
  67. ConvertedWeight = EarthWeight * 1.15;
  68. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Uranus.\n";
  69. }
  70.  
  71. if(PlanetChosen == 7)
  72. {
  73. ConvertedWeight = EarthWeight * 1.12;
  74. cout << "\nYour weight of " << EarthWeight << " pounds would be "<< ConvertedWeight << " pounds on the planet Neptune.\n";
  75. }
  76.  
  77.  
  78. system("PAUSE");
  79. return EXIT_SUCCESS;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement