Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Banking Application using Arrays and Functions. Create three arrays called Namesand accountnumbersand balance Notice that the Namesarray is a string array while accountnumbersand balancewill hold

Banking Application using Arrays and Functions.

Create three arrays called Namesand accountnumbersand balance

Notice that the Namesarray is a string array while accountnumbersand balancewill hold numeric values.

  • Display the menu with the following options and ask for the user input.

Type P to populate accounts

Type S to search for account.

Type E to exit.

  • If the user types P.
  • Populate all the three arrays up to5 values
  • And display the menu again.
  • If the user types S then:
  • Ask the user for the account number.
  • Search the array for that account number and find its position in the accountnumbers array.
  • Display the Name, and balance at the position found during the above search.
  • If the user types E. then:
  • Terminate the program with the following message
  • Thank you for using the program.
  • Bye
  • If the user types any other option:
  • Display the message "Invalid choice. Please try again!" and go back and display the menu.

PS: You program must keep displaying the menu until the user types the option E, to exit the program.

Exact messages to display, menu options, please refer to the test case scenario below:

Test Cases

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'P'

Please enter a name: 'John'

Please enter an account number: 1

Please enter a balance: 100

Please enter a name: 'Susan'

Please enter an account number: 2

Please enter a balance: 200

Please enter a name: 'Mary'

Please enter an account number: 3

Please enter a balance: 300

Please enter a name: 'Maria'

Please enter an account number: 4

Please enter a balance: 400

Please enter a name: 'Adam'

Please enter an account number: 5

Please enter a balance: 500

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'S'

Please enter the account number to search: 2

Name is: Susan

Susan account has the balance of : $200

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'S'

Please enter the account number to search: 5

Name is: Adam

Adam account has the balance of : $500

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'S'

Please enter the account number to search: 5

Name is: Adam

Adam account has the balance of : $500

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'S'

Please enter the account number to search: 9

The account number not found!

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'A'

Invalid choice. Please try again!

**** MENU OPTIONS ****

Type P to populate accounts

Type S to search for account

Type E to exit

Please enter your choice: 'E'

Thank you for using the program.

Bye

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions