Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***************PYTHON 2********************** Use Module6: Hw1 homework to do this homework. You are going to build new features to this simple banking program. All the additional

***************PYTHON 2**********************

Use Module6: Hw1 homework to do this homework. You are going to build new features to this simple banking program. All the additional features that I am asking are in Bold. Please note that program that are written without functions will loose 25% of the grade.

  • Write a program to 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 D to deposit Amount

Type W to withdraw Amount

Type E to exit.

  • If the user types P.
    • Populate all the three arrays.
    • And display the menu again.
  • If the user types D then:
    • Ask the user for the account number.
    • Search the accountnumbers() array for that account number and find its position.
    • Ask the user for the amount to be deposited.
    • Add the deposit amount to the balance for that account.
  • If the user types W then:
    • Ask the user for the account number.
    • Search the accountnumbers() array for that account number and find its position.
    • Ask the user for the amount to be withdrawn.
    • Subtract withdrawal amount from the balance for that account only if there is enough balance. Other wise display the message "ERROR: Not enough balance"
  • If the user types S then:
    • Ask the user for the account number.
    • Search the array for that account number and find its position.
    • Display the Name, and balance at the position found during the above search.
  • If the user types E. then:
    • Terminate the program after displaying the message "Thank you for using the program. Bye" Please see the sample test case scenario for exact message.
  • If the user types any other option:
    • Display the message Invalid Choice. 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.'

Mimir Requirement: The file name must be CS902Module6Homework2.py

For exact input and output messages, please refer to the test case scenario below:

Test Scenario:

**** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount 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: 'Maria' Please enter an account number: 3 Please enter a balance: 300 Please enter a name: 'Sammy' Please enter an account number: 4 Please enter a balance: 400 Please enter a name: 'Ravi' 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 D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'S' Please enter the account number to search: 1 Name is: John and the balance is: 100 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'D' Please enter the account number to add deposit: 1 Please enter the amount to be deposited: 100 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'S' Please enter the account number to search: 1 Name is: John and the balance is: 200 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'W' Please enter the account number to withdraw: 1 Please enter the amount to be withdraw: 50 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'S' Please enter the account number to search: 1 Name is: John and the balance is: 150 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'W' Please enter the account number to withdraw: 1 Please enter the amount to be withdraw: 200 ERROR: Not enough balance **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'S' Please enter the account number to search: 1 Name is: John and the balance is: 150 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'D' Please enter the account number to add deposit: 5 Please enter the amount to be deposited: 500 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount Type E to exit Please enter your choice: 'S' Please enter the account number to search: 5 Name is: Ravi and the balance is: 1000 **** MENU OPTIONS **** Type P to populate accounts Type S to search for account Type D to deposit Amount Type W to withdraw Amount 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 D to deposit Amount Type W to withdraw Amount 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_2

Step: 3

blur-text-image_3

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

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions