Question
please write in C++ Implement the Account class which contains two private data elements, an integer accountNumber and a floating-point value accountBalance, and the following
please write in C++
Implement the Account class which contains two private data elements, an integer accountNumber and a floating-point value accountBalance, and the following default constructor and member functions:
A default constructor that set initial values for accountNumber and accountBalance to 0.
Getter and setter functions for each attribute (accountNumber and accountBalance).
The inputTransaction function, which takes a character value for transactionType ('D' for deposit and 'W' for withdrawal), and a floating-point value for transactionAmount, which updates accountBalance. This function should give an error message if there is no sufficient amount for withdrawal.
The calculateFutureBalance function, which takes annual interest rate and number of years, and then calculates the future balance for the given period. For example if the current amount is 1000, we pass 0.05 as the interest and 1 as the number of years, the amount will be 1050 at the end of the year.
The mortgageYear function, which takes total amount of a mortgage and then calculates the number of years required to pay the mortgage only by using the interest of the current balance. Note that for the mortgage apart from the lump sum we have to pay, there will an interest for the borrowed money.
Let say we have morgage for 100.000 with annual interest rate 8.90 %, and we do annual payments. Lets assume we have 300.000 in our account with 5% interest rate. At the end of first year mortgage will become 108.900 and from my money I will have 15000 interest rate. Then I can reduce the morgage to 93900.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started