what is going on with this math? i searched up how to convert the weight of something on mars for this assignment, and the formula isn’t working for some reason. what am i doing wrong?
Here is the code:
#include
int main() {
// Add your code below
int WeightOnMars;
int WeightOnEarth;
WeightOnMars = WeightOnEarth * (3.73 / 9.81);
std::cout << “Enter your weight\n”;
std::cin >> WeightOnEarth;
std::cout << " Your weight is " << WeightOnMars << " KG\n";
Then, you prompt the user for input and assign it to WeightOnEarth. But, your calculation for WeightOnMars has already been performed, so this input value doesn’t make a difference.
Instead you should consider re-arranging your code so that you get and assign the user input to WeightOnEarth first and then perform the calculation for WeightOnMars.