Question: class BankAccount { public: void SetName ( string newName ) ; / / ( a ) Declare the function that sets the balance double SetBalance

class BankAccount {
public:
void SetName(string newName);
//(a) Declare the function that sets the balance
double SetBalance(double a);
void Print(){ cout << name <<" has $"<< balance << endl; }
private:
string name;
//(b) Declare the missing data item
double
};
void BankAccount::SetName(string newName){
name = newName;
}
//(c) Define member function to set the balance
int main(){
BankAccount myChecking;
//(d) Below, set myCheckings name to "PiggyBank"
// and set balance to $1250.75
//(e) Below, output the bank account's name and balance.
return 0;
}

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 Programming Questions!