Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with syntax for Banking System program using C++ programmin languange. You will write a program that will help in the management of a

Need help with syntax for Banking System program using C++ programmin languange. You will write a program that will help in the management of a private bank. General Requirements

Write a program that reads (each time the program is executed) from the secondary storage froma file named accounts.txt the account numbers and balances into a multi-dimensional array

Your program will ask the user to choose one of the following options:

1.Deposit Money

2.Withdraw Money

3.Transfer Money

4.Show Transactions

5.Open an Account

6.Close an Account

7.Sort Accounts from largest balance to smallest

8.Sort Accounts in alphabetical order using the account owners name

9.Quit Program

The program will have at least ten user-defined functions (one function for each of the eightoptions 1-8, one to print the options menu, and one to find the index of the account in the array).

The program will save the transactions information in a separate file that has the same name asthe account number (e.g. for account number: 15689 the file name will be 15689.txt)

If the user tries to withdraw more than the available balance an error message will be displayedand the transaction will not be processed.

Closing an account will only flag the account rather than permanently delete the account.

If the user tries to close a non-zero balance account an error message will be displayed and thetransaction will not be processed.

When the user decides to quit the new balances are saved back to the secondary storage to thesame file (i.e. accounts.txt)

The first functions name is printOptionsMenu, which will print (show on the screen)

-----------------------------------------------------------------------------------------------------

Please choose one of the following options:

1.Deposit Money

2.Withdraw Money

3.Transfer Money

4.Show Transactions

5.Open an Account

6.Close an Account

7.Sort Accounts from largest balance to smallest

8.Sort Accounts in alphabetical order using the account owners name

9.Quit Program

-----------------------------------------------------------------------------------------------------

The second functions name is getArrayIndexOfAccount, which receives two parameters (the account number and the array of accounts) and returns the index of the account in the array if found; otherwise; the function returns -1.

The third functions name is depositMoney, which receives three parameters (the index of the account in the array, the amount to be deposited, and the array of accounts). The function will update the balance and will save the transactions information (including the date and time) in the file that has the same name as the account number.

The fourth functions name is withdrawMoney, which receives three parameters (the index of the account in the array, the amount to be withdrawn, and the array of accounts). The function will update the balance and will save the transactions information (including the date and time) in the file that has the same name as the account number.

The fifth functions name is openAccount, which asks for the account owners information (e.g. name and opening balance). The function will add a new record to the array of accounts and accounts.txt as well as create a new file (with the same name as the account number) and update the transactions information (including the date and time) with the opening balance.

The sixth functions name is closeAccount, which checks the balance before flagging the account as deleted. If the balance is not zero, an error message will be displayed and the transaction will not be processed.

The sixth functions name is closeAccount, which checks the balance before flagging the account as deleted. If the balance is not zero, an error message will be displayed and the transaction will not be processed.

The seventh functions name is sortBalances, which receives one parameter (the array of accounts). The function will sort and display the accounts (without changing the original array) from largest balance to smallest.

The eight functions name is sortNames, which receives one parameter (the array of accounts). The function will sort and display the accounts (without changing the original array) in alphabetical order using the account owners name.

Make sure to follow the instructions carefully including using the exact function names with the exact letter cases (upper and lower case letters). Your programs are going to be tested using a unified main function that is developed for that purpose. If the unified main function does not compile this indicates inconsistencies in meeting the above requirements and will result in a zero grade.

All functions (except the main function) will be defined as follows:

1. The function prototype appears before the main

2. Comment describing what the function does appears directly under function prototype

3. Formal variable names are not used in any prototype

4. The functions definition appears after the main

Additional Requirements:

Be sure to comment your code adequately.

Be sure to indent properly. Check the textbook to see how it should be done.

Use self-documenting variable names

Sample contents of the accounts.txt file:

Serial Account FirstName LastName Balance Flag

1 56897 Richard Dustin 1001.59 0

2 43534 Michael Smith 123.55 0

3 65743 George Gonzales 10.66 0

4 43346 Donald Malik 0 1

5 97867 Owen Evelyn 5527.10 0

6 38531 Lucas Wyatt 7891.22 0

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago