Question
Define the Member class's SetName() mutator that sets data member name to memberName and the SetHeight() mutator that sets data member height to memberHeight. Ex:
Define the Member class's SetName() mutator that sets data member name to memberName and the SetHeight() mutator that sets data member height to memberHeight.
Ex: If the input is Eve 3.0, then the output is:
Member: Eve Height: 3.0 feet
#include
class Member { public: void SetName(string memberName); void SetHeight(double memberHeight); void Print() const; private: string name; double height; };
/* Your code goes here */
void Member::Print() const { cout << "Member: " << name << endl; cout << "Height: " << fixed << setprecision(1) << height << " feet" << endl; }
int main() { Member person; string inputName; double inputHeight;
cin >> inputName; cin >> inputHeight; person.SetName(inputName); person.SetHeight(inputHeight);
person.Print();
return 0; }
c++ and please please make it correct
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started