Question: class yourAccount / / Line 1 Class name { / / Line 2 public: / / Line 3 yourAccount ( ) ; / / Line

class yourAccount //Line1 Class name{//Line2public: //Line3yourAccount(); //Line4 Default ConstructoryourAccount(float); //Line5 Constructorfloat deposit(float); //Line6 Function depositfloat withdraw(float); //Line7 Function withdrawvoid printBalance(); //Line8 Function printBalanceprivate: //Line9float balance; //Line10 Member variable balance
}
Find the syntax errors in the following class definition. There are three errors.Answer:Line: Correction:class YourAccount //Line1 Class name{//Line2public: //Line3Account(); //Line4 Default ConstructorAccount(float); //Line5 Constructorfloat deposit(float); //Line6 Function depositfloat withdraw(float); //Line7 Function withdrawvoid printBalance(); //Line8 Function printBalanceprivate: //Line9float balance; //Line10 Member variable balance
};
Create a test program for yourAccount

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!