Question: Instructor PROJECT (More on Class Construction and Object Instantiation ) Objective To construct a class and instantiate objects. PROJECT DESCRIPTION Write a complete program which





Instructor PROJECT (More on Class Construction and Object Instantiation ) Objective To construct a class and instantiate objects. PROJECT DESCRIPTION Write a complete program which uses a class called Account to write a banking program that maintains an account balance and provides for deposit and withdrawal transactions for a noninterest - bearing account. Information about This Project The heart of object - oriented programming is class construction, object instantiating and using the objects associated with the class. Steps to Complete This Project Create a class called Account to write a banking program that maintains an account balance and provides for deposit and withdrawal transactions for a noninterest - bearing account. The program is to use keyboard entry for both the transaction type and for the amount. The program input, process and output is outlined below. Your program is to accept the following user inputs: (1) Transaction type: d for deposit w for withdrawal (2) Amount of transaction Your program is to compute / process the following items: (1) The account balance (2) Add a deposit (3) Subtract a withdrawal (4) Display message if transaction is invalid Your program is to output each of the following: PROJECT (Class Construction and Object Instantiation ) (1) the transaction description (2) the transaction amount (3) the account balance Your program is to utilize the following variables and their associated data types: Your program is to utilize the following functions ( methods ) and their respective purposes: Your program is to utilize the following functions ( methods) and their respective purposes: Use the following start code for the Account class function Calculate() When using the strcpy_s() function, as in the case of function Calculate (), remember to include the preprocessor directive \#include . Note - if strcpy_s () function is not working with your compiler version, feel free to use strcpy () as a function or a string type to store stDescription data values. I/ statements for the Account class function Calculate() if ( cType == ' d ' 11 cType == 'D') f strcpy_s(stDescription, "Deposit"); fBalance += fAmount; Student Name Section else if (cType = 'w' |I cType == 'W') \{ strcpy_s (stDescription, "Withdrawal"); fBalance = fAmount; \} else \{ strcpy_s(stDescription, "Invalid"); cout "Invalid Transaction Type" endi; PROJECT (Class Construction and Object Instantiation) Submit both your program code as well as any run time image(s) of your output from the various scenarios of account management transactions and detail. STEP 4 Questions and Answers Concerning this Computer Project Answer the following questions in your own words. Open MS Word and, within your lab submittal document, place your responses to each of these questions. Submit your completed MS Word document for credit. (1) What does the function strcpy_s() accomplish? (2) What other account scenarios ( other than bank transactions ) involve deposits and or withdrawals. (3) Modify the Calculate() function to include the addition of bank interest at an interest rate of 0.02 to the account balance after each deposit. Include below the code for the modified Calculate() function and a snapshot of the output. (4) If you used an overloaded constructor for this application, what parameters would you use for this function? (5) If you used a destructor for this application, what would this function accomplish
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
