Question: Account Class Create the new project Assign03-AccountClass. Click the Project tab and select Add New Item... Add a header file named Account.h and then repeat

 Account Class Create the new project Assign03-AccountClass. Click the Project taband select Add New Item... Add a header file named Account.h and

Account Class Create the new project Assign03-AccountClass. Click the Project tab and select Add New Item... Add a header file named Account.h and then repeat the process to add an implementation module named Account. cpp to hold C++ code. Name the class Account. Use this class description (public and private member function prototypes and private data members) to provide necessary definitions for Account.h: #ifndef ACCOUNT_H Account.h class header file #define ACCOUNT_H Open the two Account text files in C:\VCProjectsOOP #include and copy the contents of AccountHeader.txt to Account.h using namespace std; | and AccountClassDriver.txt toAccountClass.epp class Account public: Account(); // default constructor Account(string name, double amount); Il constructor with parameters getAccountID() const; II ACCESSOR member functions string getAccountHolder() const; // return name of account holder double getBalance() const; // return account balance void setAccountHolder(string name); // MUTATOR member functions void setBalance (double amt); // assign amount to balance void depositAmount(double amt); // add amount to balance void withdrawamount(double amt); // subtract absolute value of amount from balance void displayAccountInfo() const; // display account information private: static int accountNumber; // last account# value static data member int getNextAccountNumber() const; // next account# return incremented accountNumber accountID; // account# identifier string accountHolder; // name of account holder double balance; // account balance int int #endif Define a label ACCOUNT_H that indicates whether the Account.h header file has already been included in the project (it might be included in more than one of the files that make up this Visual Studio C++ project. Code the implementation file Account.cpp to provide the operations of the class member functions declared in the header file. Be sure to include the scope identifier Account:; in front of each function name in the implementation file to identify each function as part of the Account class. Include needed preprocessor directives and using namespace std for the code in these routines. #include "stdafx.h" #include "Account.h" #include #include #include // include fabs( ) absolute value function using namespace std; The member functions set and get values for the three private data members of the class. Two helper functions carry out other useful operations -- displayAccountInfo() and getNextAccountNumber(). Provide two constructors for the Account class a default constructor (no parameters) and a parameterized constructor that accepts the account holder name and starting account balance. Each constructor begins by getting the next account number from a routine that increments the number by 1 before returning the value

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