Need help with this
Instructions:
Design and implement a class called bankAccountType according to the specified UML diagram.
bankAccountType
- customerName: string
- accountBalance: double
+ bankAccountType (string, double) + deposit(double)
+ withdraw(double)
+ setName(string)
+ getName() const: string
+ getBalance() const: double
According to this UML diagram, the class bankAccountType will have two PRIVATE member variables: a string called customerName and a double called accountBalance.
The class will have a parameterized constructor and the following PUBLIC member functions:
- a bankAccountType constructor that will set customerName and accountBalance to the values
- passed to the object at instantiation.
- a void function called deposit that receives a double and adds that received value to the value of
- accountBalance.
- a void function called withdraw that receives a double and subtracts it from the value of
- accountBalance. This function should not process a transaction that would result in a negative
- account balance. Instead, this function should output a warning stating insufficient funds.
- A void function called setName that receives a string and sets customerName.
- A value returning function called getName that returns the customerName. This function should
- be prevented from modifying the member variables.
- A value returning function called getBalance that returns the accountBalance. This function
- should be prevented from modifying the member variables.
Last, wrote test client to instantiate a bankAccountType object and test its public functions. Include the class definition, class implementation and test client in a single .cpp file. These requirements closely resemble the example program, so use the slides as a guide. Submit on Blackboard in the usual format