-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathspace.cpp
More file actions
37 lines (35 loc) · 723 Bytes
/
space.cpp
File metadata and controls
37 lines (35 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
using namespace std;
int main() {
double w;
int p;
cout << "Enter your weight\n";
cin >> w;
cout << "Enter the Planet number\n";
cin >> p;
switch (p){
case 1:
w=w*0.78;
cout << "Your weight on Venus will be " << w;
break;
case 2:
w=w*0.39;
cout << "Your weight on Mars will be " << w;
break;
case 3:
w=w*2.65;
cout << "Your weight on Jupiter will be " << w;
break;
case 4:
w=w*1.17;
cout << "Your weight on Saturn will be " << w;
break;
case 5:
w=w*1.05;
cout << "Your weight on Uranus will be " << w;
break;
default:
cout << "Invalid Input\n";
break;
}
}