Question: Need help on c++ homework. Thanks Need help updating code from last assignment to this one assignment above. Here is the code to update below.
Need help on c++ homework. Thanks
Need help updating code from last assignment to this one assignment above.
Here is the code to update below.
#include
using namespace std;
class Weight
{
double earthweight;
public:
void setEarthweight(double weight)
{
earthweight=weight;
}
double getEarthweight()
{
return earthweight;
}
double mercury(double oWeight) {
return oWeight * 0.38;
}
double venus(double oWeight) {
return oWeight * 0.91;
}
double mars(double oWeight) {
return oWeight * 0.38;
}
double moon(double oWeight) {
return oWeight * 0.17;
}
};
int main(){
double userInput;
Weight w;
again:
cout
cin >> userInput ;
w.setEarthweight(userInput);
if(w.getEarthweight()
cout
goto again;
}
int userselection; do {
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
pdate 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 default:
cout
}
}while(userselection!=6);
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
