Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Objective This challenge lab will enable you to apply, in a practical scenario, the topics we have introduced in the class so far: input/output

1. Objective This challenge lab will enable you to apply, in a practical scenario, the topics we have introduced in the class so far: input/output including files, variables, conditionals and loops.

2. Learning outcomes After completing this assignment, you will be able to: Analyze problems and express a solution algorithm using pseudocode. Implement a pseudocode algorithm in a high-level language, including the correct use of arithmetic and logical expression and simple input/output operations. Use the syntax and semantics of a high-level language to represent: basic variable, assignment and arithmetic operations and basic control structures (if-then, for-loop, while-loop).

3. Your Challenge A Secure, Personal Banking App You have been hired by CS 1301 and CS 1101 instruction team to create a program that enables a user to do online banking transactions, called minerBank.

3.1. Verifying credentials Your first task is to verify credentials for each user by asking the user for their username and PIN as follows: Enter username: Enter PIN: You will verify the user credentials by reading the information of each user from the file users.txt (included for this assignment). This file will have on each row the following user information: username, pin, checking account balance, savings account balance. University of Texas at El Paso - Department of Computer Science CS1101: Introduction to Computer Science Lab Spring 2019 Comprehensive Lab 1 2 For example, the file users.txt may have the row provide below with information about Alice. This row indicates that user name is alice, her password is 1234, her checking account balance is $500 and her savings account balance is $400. alice 1234 500 400 You will verify that the username and PIN entered by the user in 3.1. matches the username and PIN obtained from the users file. A user only has 3 opportunities to enter the correct password, otherwise the program will exit with the following message: Your username or passwords is not correct.

3.2. Display menu If the user provides valid credentials, minerBank will have a simple menu at the beginning: 1. Check Balance 2. Withdraw Money 3. Deposit Money 4. Transfer Money 5. Exit Welcome to minerBank! Enter the menu option you want (1 to 5):

3.3. Option 1. Check balance. This option will further ask the user to choose between checking account and savings account. Select one of the following options: 1. Checking Account 2. Savings Account Your program will display the balance for the corresponding account.

3.4. Option 2. Withdraw money. This option will: a. Ask the user to choose between checking account and savings account (refer to 3.3). b. Ask the user the amount of money they would like to withdraw from the selected account. The user is not allowed to withdraw more than $200 or more than what their current balance is. c. Subtract the amount from the corresponding account. University of Texas at El Paso - Department of Computer Science CS1101: Introduction to Computer Science Lab Spring 2019 Comprehensive Lab 1 3 d. Print the final balance from the corresponding account.

3.5. Option 3. Deposit money. This option will: a. Ask the user to which account they would like to make a deposit (checking or savings, refer to 3.3). b. Ask the user the amount of money they would like deposit, no more than $1200 is allowed. c. Print the final balance from the corresponding account.

3.6. Option 4. Transfer money. This option will: a. Ask the user from which account they would like to withdraw from (checking or savings, refer to 3.3). b. Ask the user the amount of money they would like to transfer where no more than $200 or more than what their current balance has is allowed. c. Transfer from the selected account to the other. d. Print the final balance of both accounts.

3.7. Option 5. Exit This option will print a goodbye message created by you. Notes: Assume that usernames provided in the file users are unique. The final balances for a users account will not be recorded in the file, just displayed in the screen.

4. Testing Case Assume Alice wants to transfer 150 from her checking to her savings account. Her information in the file is as follows: alice 1234 500 400

Step 1. Alice will enter the username alice followed by 1234.

Step 2. Alice will input option 4 for transferring money, followed by the option 1 for checking account. Alice will be prompted to input the transfer amount. Alice will input 150. Input the transfer amount:150 University of Texas at El Paso - Department of Computer Science CS1101: Introduction to Computer Science Lab Spring 2019 Comprehensive Lab 1 4 The final balance of your checking account is: $350 The final balance of the savings account is $550

Step 8. Alice is presented with the main menu, where she types option 5 (Exit). The good bye message is printed and the program ends. Bonus: Think about a bonus feature you could include that will allow you to practice using input/output operations, a sequence of steps, conditionals or loops, and testing cases. You should include the code of your bonus feature and explain this feature during the demo to the instruction team. Possible bonus features will be discussed during the labs, think about how to make your code more robust, or add additional features such as calculating a fee for using the app.

The user.txt file contains:

john 3456 100 234 diego 9012 1000 300 alice 1234 500 400 ana 9078 145 450 joe 8887 0 90 maria 2221 9000 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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions