Hi,
I'm doing another homework problem and I've been stuck for a couple of hours. The assignment is to find your weight on the different planets. Right now, I've been able to tell the user their weight on ONE planet. How do I use cout statement to tell the user their weight on the different planets. HEre is what I have so far:
Code:
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
float weight;
char planet;
const float Mercury = 0.4155;
const float Venus = 0.8975;
const float Earth = 1.0;
const float Moon = 0.166;
const float Mars = 0.3507;
const float Jupiter = 2.5374;
const float Saturn = 1.0677;
const float Uranus = 0.8947;
const float Neptune = 1.1794;
const float Pluto = 0.0899;
cout<< "Enter your weight in pounds" <<endl;
cin>> weight;
cout<< "Enter the name of a planet" <<endl;
cin>> planet;
cout<< "Your weight on Mars is " <<weight*Mars <<"."<<endl;
return 0;
}
Thanks!