You are asked to write a program to organize accounts in a bank.  Suppose all the accounts are stored in…

You are asked to write a program to organize accounts in a bank.  Suppose all the accounts are stored in a data file called “account.dat”.

 

A typical input data file looks like:

 

1234456

1 8 1943

Margaret Mitchell

1000.00

3456781

1 12 1955

Mario Puzo

9930.00

 

For instance, the above file has information about two customers. For every customer, the first line gives the account number (of type string), the second line gives the birth date (month, followed by day, followed by year, all integers), the third line gives the first (string) and last (last) names, and the fourth line gives the account balance (float).

 

Your program should first read the information from this data file and store the information in an array (called customers) of objects.  Each array element corresponds to one customer and is an instance a class (header and implementation files) with the following members:

 

Private members:

            accountNumber (data type: a string)

birthMonth  (data type: integer)

birthDay (data type: integer)

birthYear (data type: integer)

firstName (data type: a string)

lastName (dat type: a string)

balance ( data type: float)

 

Public members

           void withdraw( float amount);

void deposit (float amount);

void printBalance( );  // print out the balance on screen

 

           customer(  );   // default constructor

// No parameterized constructor

           // you also need to define the necessary get and set functions

 

Your program should provide a menu that allows users to withdraw, deposit, and print balance.  The menu should allow users to create a new account for a new customer. Your menu should also allow users to save the updated account information (including the accounts that were newly created) to an output file called updated_account.dat.

 

An example of menu is given below:

 

 

————————–Menu—————————-

1-      New Account

2-      Withdraw

3-      Deposit

4-      Print Balance

5-      Save Accounts to File

6-      Quit

 

Please enter your choice (1-6):

———————————————————-

 

When you access an existing customer account (choices 2, 3, and 4 in the menu), you need to ask the user for the account number and then, use the account number as a search key to find the record in the customers array. Essentially, you execute a for loop through all the customers and find a match of the account number to locate that particular customer.

 

Component 1:   Software System Design

 

Provide a use case diagram and a class diagram for your project

 

Component 2:   Assurance of Software Correctness

 

Find out a set of preconditions and postconditions for each function in this project.  Summarize the result in the following table.

 

Function name

Precondition

Postcondition

 

 

 

 

Component 3:   Software Testing

 

Design a complete suite of test cases for all possible scenarios in using your program. Summarize your test plan in the following table.

 

Reason for Test Case

Input Values

Expected Output

Observed Output

 

 

 

 

 

 

Component 4:   Software Documentation

 

Precede each function with the following standard information:

 

//   Purpose: …

//   Author: ….

//   Creation Date: …

//   Last Modification Date: …

//   Precondition:  

//   Postcondition:  

 

Also, include a comment at the beginning of the program that includes the following information:

 

//   Purpose: …

//   Author: ….

//   Creation Date: …

//   Last Modification Date: …

 

Component 5:   Screen Shots

 

Create a number of screen shots to demonstrate the running results of your program.

 

 

 

 

Submission of Your Work

 

You need to prepare a SINGLE MS word document that contains all of your answers to Components 1-5 as well as your source code (by copy-and-paste). 

Don't hesitate - Save time and Excel

Are you overwhelmed by an intense schedule and facing difficulties completing this assignment? We at GrandHomework know how to assist students in the most effective and cheap way possible. To be sure of this, place an order and enjoy the best grades that you deserve!

Post Homework
Top