Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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 mainimage text in transcribedimage text in transcribed

Above is the expected output if the input is 1. Being confusing for the errors. image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago