Question: C++ 2 related programs Problem 1 Develop a class BankAccount that supports these methods: BankAccount0: initializes the bank account balance to the value of the
Problem 1 Develop a class BankAccount that supports these methods: BankAccount0: initializes the bank account balance to the value of the input argument(the value is a double). It initializes the bank account object to 0 if no input argument is given. withdraw0: takes an amount as input and withdraws it from the balance deposit0:takes an amount as input and adds it to the balance balance0: returns the balance on the account compareto0: returns an integer indicating if two bank accounts have the same amount If both the bankaccounts are equal then this method returns 0 else it returns positive or negative value. The result is positive if the first is greater than the second bankaccount else the result would be negative. tostring0: returns a string representation of the object. Problem 2 In the previous exercise we created a BankAccount class Modify the implementation of BankAccount class in order to overload all the following operators so that they correctly apply to the type BankAccount:-=, >. The m: operator should return true if the two BankAccount values are identical, while > should input the balance in dollars. Create appropriate tests for the overloaded operators
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
