Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON PLEASE Lab 4 C: Cha - Ching For this lab, use a while loop. A sentinel loop is a loop that continues to process

PYTHON PLEASE
Lab4C: Cha-Ching
For this lab, use a while loop.
A sentinel loop is a loop that continues to process data until it reaches a specific value(s) that signals that it should stop looping; this special value(s) is usually indicated as the condition of the while loop. A very common application for this is allowing a user to rerun a program.
Write a very simple program that mimics a bank account. The program should start the user out with $1000. It should print out a welcome message once, followed by the options present for the user. The program should allow the user to make a deposit, withdrawal, and see their current balance. Every time the user deposits or withdraws, the program should show the user their new balance; it should also ask the user if they want to return to the main menu. As long as the user types 'Y' or 'y', the program should keep running.
The user input is indicated in bold.
Sample output:
Welcome!
You have $1000 in your account.
Menu
0- Make a deposit
1- Make a withdrawal
2- Display account value
Please make a selection: 1
How much would you like to withdraw?: 50
Your current balance is $950
Would you like to return to the main menu (Y/N)? : Y
Menu
0- Make a deposit
1- Make a withdrawal
2- Display account value
Please make a selection: 0
How much would you like to deposit?: 100
Your current balance is $1050
Would you like to retum to the main menu (Y/N)?: Y
Menu
0- Make a deposit
image text in transcribed

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago