Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ 12.25 (New Account class) An Account class was specified in Programming Exercise 9.3. Modify the Account class as follows: Assume that the interest rate
C++
12.25 (New Account class) An Account class was specified in Programming Exercise 9.3. Modify the Account class as follows: Assume that the interest rate is same for all accounts. So, the annual InterestRate property should be static. Add a new data field name of the string type to store the name of the custoner. Add a new constructor that constructs an account with the specified name, id, and balance. Add a new data field named transactions whose type is vectorcTransactio that stores the transaction for the accounts. Each transaction is an instance of the Transaction class. The Transaction class is defined as shown in Figure 12.4. Modify the withdraw and deposit functions to add a transaction to the transactions vector All other properties and functions are same as in Programming Exercise 9.3. The get and set functions for these data fields are provided in the class, but omitted in the UML diagram for brevity Transaction -date: Date -type: char -amount: double -balance: double -description: string +Transaction(type: char. The date of this transaction. Date is defined in Exercise 9.8 The type of the transaction, such as 'W" for withdrawal, D for deposit, etc The amount of the transaction The new balance after this transaction The description of this transaction Construct a Transaction with the specified date, type, balance, and description. amount: double, balance: double, description: string) FIGURE 12.4 The Transaction class describes a transaction for a bank account. write a test program that creates an Account with annual interest rate 15%, bal- ance 1000, id 1122, and name George. Deposit $30, $40, $50 to the account and withdraw S5, $4, $2 from the account. Print account summary that shows account holder name, interest rate, balance, and all transactionsStep 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