Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c|5p 400 Object Oriented Programming C++ 00_ Week 2 Programming Assignment Resource Requirements: Make sure you read the Introduction to GOP Example and Software Engineering

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
c|5p 400 Object Oriented Programming C++ 00_ Week 2 Programming Assignment Resource Requirements: Make sure you read the \"Introduction to GOP Example\" and \"Software Engineering Review\" document and the required textbook reading before attempting this assignment. You are also expected to have successfully completed the week 2 lab before starting on this. The lab is a scaffolding which is designed to help you successfully complete the assignment. Use the lab for guidance for code separation, scope resolution operator use and toString method etc Code Development The code that you are going to develop for this assignment is the rst step in the software development process for this course. Subsequent assignments will continue to build on this code. It is very essential that you pay attention to correct code development in this assignment to prevent errors from cascading in future assignment. Please make sure that you use standard and recommended practices that you learnt in P360 this includes top down design methodology, execution charts, good documentation and programming style and separation of code les. For now, we will stay with three les, but later if necessary, we may add an additional function header le as done in P360. Again, please do not discard the code in this assignment. You will continue to use and refine it. Specifications: 1. Design a class called BankAccount. The member elds of the class are: Account Name, Account Number and Account Balance. There are also other variables called M|N_BALANCE=9.99, REWARDS_AMOUNT=1000.00, REWARDS_RATE=0.04. They look like constants, but for now, they are variables of type double Here is the UML for the class: -string accountName ll First and Last name of Account holder -int accountNumber ll integer +getAccountNumber: int +setAccountBalance(double amount) : void +withdraw(double amount) : bool //deducts from balance and returns true if resulting balance is less than minimum balance +deposit(double amount): void //adds amount to balance. If amount is greater than rewards amount, calls // addReward method addReward(double amount) void // adds rewards rate * amount to balance +toString(): String // return the account information as a string with three lines. "Account Name: " name "Account Number:" number "Account Balance:" balance 2. Create a file called BankAccountHeader.h which is the class specification file containing the class declaration, member variable declarations and the instance methods prototypes of the BankAccount class as given in the UML diagram above. 3. Create a file called BankAccount. cpp which implements the BankAccount class as given in the UML diagram above. The class will have member variables( attributes/data) and instance methods(behaviours/functions that initialize, access and process data) 4. Create a driver class BankAccountMain.cpp to do the following: a. Declare and instantiate a bank account called accountZero using the default constructor b. Declare and instantiate a bank account called accountOne with name= "Matilda Patel" number =1232, balance=-4.00 c. Declare and instantiate a bank account called accountTwo with name = "Fernando Diaz", number=1234, balance=250 . Declare and instantiate a bank account called accountThree with name="Howard Chen", number=1236, balance = 194.56 e. Display the bank accounts in the three line format as above f. Deposit 999 dollars in Fernando's account and 1000.25 in Howards account g. Display their account information h. Withdraw 10000 from Matilda's account and 90 dollars from Fernando's accountamount j. Print the total amount of all the bank accounts created. 5. Note that the main function of the driver is to declare bank objects and to display information. Write a method called display that inputs a string and displays that string to the console. Here is the function header: void display (string information); For now, you may declare the function prototype at the beginning of the driver file, and the function definition at the bottom of the same file. We will separate the function definitions into another function header file when the number gets larger. 6. Create a file called wxxxxxxxPA2.docx. Save your testing output into this file. If you would like extra credit, you can add the execution chart of your driver program in this file. Recall that the execution chart is the sequence of method calls of the program (Look at the Software Engineering Review Document in the resource section) to review this software tool. Note that in the beginning, this chart will not be very large. In fact, it will only contain the display function. But it will keep growing as our program develops over the next few weeks. Please include single line comments in this file for a brief description of the method calls. As you know, variable declarations are not part of the execution chart and they are not to be included.Testing and Verification Test your program thoroughly. Make sure that it compiles and runs correctly. I will be inspecting your code to make sure that it addresses the prompt correctly. 80 it is not sufficient for you to demonstrate that the output matches the required one Your output should look like this Account Name: Matilda Patel Account Number: 1232 Account Balance: -4.000000 Account Name: Fernando Diaz Account Number: 1234 Account Balance: 250.000000 Account Name: Howard Chen Account Number: 1236 Account Balance: 194-560000 Account Name: Fernando Diaz Account Number: 1234 Account Balance: 1249.000000 Account Name: Howard Chen Account Number: 1236 Account Balance: 1234.820000 Insufficient funds Remaining Balance :1159 Total Amounts 22389.82

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions