Question: C++ Help! PLEASE FOLLOW ALL DIRECTIONS! NEED DONE ASAP! PLEASE INCLUDE COMMENTS AND SCREENSHOTS! Question 21 YOU ARE ALLOWED TO USE A COMPILER TO SOLVE
C++ Help! PLEASE FOLLOW ALL DIRECTIONS! NEED DONE ASAP! PLEASE INCLUDE COMMENTS AND SCREENSHOTS!
Question 21
YOU ARE ALLOWED TO USE A COMPILER TO SOLVE PROBLEM:
Define a class Account with the following Specification and attach your solution file(s) when done.
GRADE: Class Interface (30%) , Class Implementation (60%) and working program (10%)
Data Members: (20%)
private: string name; //Name of Account Owner string occupation; //Describes Account Owner's Occupation double balance; //Account Balance double rate; //Account Assigned Rate
___________________________________
Member Functions:(50%)
public: Account(string name="John Doe", string occupation = "Unemployed", double balance=0.0, double rate=0.0); void withdraw(double amount); // Withdraws an amount from Account Balance only if amount <= balance void deposit(double amount); // Deposits an amount to Account Balance only if amount > 0 void applyInterest(); // Applies interest to balance at the assigned rate of the Account. string getName(); // Return Account Owner Name string getOccupation(); // Return Account Owner's Occupation double getBalance(); // Return Account Balance double getRate(); // Return Account Rate void setName(string name);// Assign Account Owner Name void setOccupation(string occupation); // Assign Account Owner's Occupation void setBalance(double balance); // Assign Account Balance void setRate(double rate); // Assign Account Rate;
void printData(); //Print the content of the data members.
Use the following Driver to test your Class:
// Test Class Definition using the following Driver Program. int main() { Account acct1, acct2("Susan Francis","Physical Therapist", 93000.0,0.01), acct3("Thomas Thompson","IT Professional",125000.0,0.01); acct1.withdraw(130000.0); acct2.deposit(40000); acct3.deposit(4000 ); acct1.applyInterest(); acct2.applyInterest(); acct3.applyInterest(); acc1.print(); acc2.print(); acc3.print(); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
