Question: Need help on C++ homework. Thanks Need help updating code from last assignment to this assignment above. Here is the code to update below from

Need help on C++ homework. Thanks

Need help on C++ homework. Thanks Need help updating code from last

Need help updating code from last assignment to this assignment above.

Here is the code to update below from last assignment.

------------------------------------------------

Main.cpp

#include

#include "Weight_Conversion.cpp" //include file

using namespace std ;

int main(){

double userInput;

Weight w;

cout

cin >> userInput;

if(userInput

cout

}

else

w.setEarthweight(userInput);

int userselection;

do{

cout

cout

cout

cout

cout

cout

cout

cout

cout

cout

cout

cin >> userselection;

switch(userselection){

case(1):

cout

break;

case(2):

cout

break;

case(3):

cout

break;

case(4):

cout

break;

case(5):

cout

case(6):

break;

cout

default:

cout

}

} while(userselection!=6);

return 0;

}

-----------------------------------

Weight_Conversion.cpp

#include

class Weight{

double earthweight;

public:

//Constructor

Weight(){

earthweight= 100;

}

void setEarthweight(double weight){

earthweight=weight;

}

double getEarthweight(){

return earthweight;

}

double mercury(double oWeight){

if(oWeight

oWeight=earthweight;

return oWeight * 0.38;

}

double venus(double oWeight){

if(oWeight

oWeight=earthweight;

return oWeight *0.91;

}

double mars(double oWeight){

if(oWeight

oWeight=earthweight;

return oWeight *0.38;

}

double moon(double oWeight){

if(oWeight

oWeight=earthweight;

return oWeight *0.17;

} };

Add a derived class that will calculate weight conversions to kilograms to Weight_Conversion.cpp The class will have methods that will convert user input in pounds to kilograms. Update Program with two files main.cpp Weight_Conversion.cpp Use a class constructor to initialize class values for weight to 100 pounds. Program should let the user know the execution is with a default value for the program. Output all the weight conversions with the default value if the user enters an amount

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!