Question: #include #include using namespace std; int main() { double mass, weightEarth, weightMoon, weightMars; //Declare variables for earth,moon and mars const double earth = 9.81; const

#include

#include

using namespace std;

int main() {

double mass, weightEarth, weightMoon, weightMars;

//Declare variables for earth,moon and mars

const double earth = 9.81;

const double moon = 1.62;

const double mars = 3.77;

cout

cout

cin >> mass;

if (mass

cout

else

{

weightEarth = mass * earth;

weightMoon = mass * moon;

weightMars = mass * mars;

//formatting using setw ,left and right

cout

cout

cout

cout

if (weightEarth

cout

else if (weightEarth >= 1000)

cout

}

return 0;

} //End function main#include #include using namespace std; int main() { double mass, weightEarth, weightMoon,weightMars; //Declare variables for earth,moon and mars const double earth = 9.81;

Above is the expected output if the input is 1. Being confusing for the errors. const double moon = 1.62; const double mars = 3.77; cout cout

packages. C4700 uninitialized local variable 'mass' used lesson4part1 lesson4part1.cpp 21 tro

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!