Your weight is actually the amount of gravitational force exerted on you by the earth. Moons gravity is one sixth (0.167) that of the earth gravity. Write a program that asks the user to enter his/her weight on the earth and display the corresponding weight on the moon.
#include<iostream>
usingnamespace std;
int main()
{
cout << "Please enter what your weight would be on earth.";
cin >> weight;
cout<<"Your weight on the moon is "return 0;
}
#include<iostream>
usingnamespace std;
int main()
{
int weight;
cout << "Please enter what your weight would be on earth.";
cin >> weight;
weight * 0.167;
cout << "Your weight on the moon is \n: ";
return 0;
}
#include<iostream>
usingnamespace std;
int main()
{
int weight;
cout << "Please enter what your weight would be on earth.";
cin >> weight;
cout << "Your weight on the moon is \n:"<< (weight * 0.167); // This
return 0;
}
You need need to output that new weight to the screen. So either output directly 'weight * 0.167' or store this new weight in a variable and output that variable.
1 2 3 4 5 6
double NewWeight = weight * 0.167;
cout << "Your weight on the moon is : " << NewWeight;
/* Or you can do the following:
cout << "Your weight on the moon is : " << weight * 0.167
*/