looking for help with exercise please provide a simple python script and explanation  I have provided my code as well what would you change? Write a program that keeps track of user's balance in their account after each transaction. Have the program ask for their initial balance and then keep track of their current balance after each transaction, until the user stops the program. 1. Welcome banner 2. ask for starting balance 3. ask to specify transaction type in (w) for withdrawal or (d) for deposit. 4. prompt the user for the amount for the transaction. doesn't need to be validated. 5.print the new balance 6. prompt the user if they want to continue with another transaction. if they enter Y or y repeat steps 3-6.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

looking for help with exercise

please provide a simple python script and explanation 

I have provided my code as well

what would you change?

Write a program that keeps track of user's balance in their account after each transaction. Have the program ask for their initial balance and then keep track of their current balance after each transaction, until the user stops the program.

1. Welcome banner

2. ask for starting balance

3. ask to specify transaction type in (w) for withdrawal or (d) for deposit.

4. prompt the user for the amount for the transaction. doesn't need to be validated.

5.print the new balance

6. prompt the user if they want to continue with another transaction.

if they enter Y or y repeat steps 3-6.

 

 

1 dash="-"*60
2 print ("Welcome to Funnyville Bank.")
3 print ()
4 print (dash)
6 withdraw-0
7 deposit-0
8 choice="Y"
69
10 while (choice.lower ()="y") :
11
12
while True:
13
14
start=int (input ("Please enter your starting balance: "))
transaction=input ("please enter the type of transaction (w/d) : ")
print ()
15
print (dash)
16
17
18
19
20
21
if (transaction=="W" or transaction.lower ()=="w"):
withdraw-int (int ("please enter amount:")
new-start-withdraw
print ("New balance: ", new)
print ()
print (dash)
24
25
26
new-new
break
elif(transaction=-"D" f transaction.lower )=="d"):
desposit=int (int ("please enter amount:" )
new-start+deposit
print ("New balance:", new)
29
30
print ()
print (dash)
32
33
34
35
new-new
break
else:
print ("Please enter (W/D) for transaction type.)
37
choice = input ("Continue? (Y/N): ")
39
40
41
if (choice.lower () !-"y"):
print ("-
print ("New Balance:",new)
print ("Bye!"
42
43
44
45
46
Ln: 26 Col: 3
2 3
224N 3
330 3
9333
Transcribed Image Text:1 dash="-"*60 2 print ("Welcome to Funnyville Bank.") 3 print () 4 print (dash) 6 withdraw-0 7 deposit-0 8 choice="Y" 69 10 while (choice.lower ()="y") : 11 12 while True: 13 14 start=int (input ("Please enter your starting balance: ")) transaction=input ("please enter the type of transaction (w/d) : ") print () 15 print (dash) 16 17 18 19 20 21 if (transaction=="W" or transaction.lower ()=="w"): withdraw-int (int ("please enter amount:") new-start-withdraw print ("New balance: ", new) print () print (dash) 24 25 26 new-new break elif(transaction=-"D" f transaction.lower )=="d"): desposit=int (int ("please enter amount:" ) new-start+deposit print ("New balance:", new) 29 30 print () print (dash) 32 33 34 35 new-new break else: print ("Please enter (W/D) for transaction type.) 37 choice = input ("Continue? (Y/N): ") 39 40 41 if (choice.lower () !-"y"): print ("- print ("New Balance:",new) print ("Bye!" 42 43 44 45 46 Ln: 26 Col: 3 2 3 224N 3 330 3 9333
Sample run 1:
Python 3.6.3 Shell
Eile Edit Shell Debug Options Window Help
Welcome to the Bank of Funnyville
Please enter the starting balance: 1000
Enter the type of transaction (w/d) : w
Enter the amount: 150
New balance = $850
Continue (Y/n) ? y
Enter the type of transaction (w/d): W
Enter the amount: 75
New balance $775
Continue (y/n) ? y
Enter the type of transaction (w/d) d
Enter the amount 200
New balance = $975
Continne (Y/n) ? n
Your final balance: $975
Goodbye!
Ln: 57 Cot 4
1.
Transcribed Image Text:Sample run 1: Python 3.6.3 Shell Eile Edit Shell Debug Options Window Help Welcome to the Bank of Funnyville Please enter the starting balance: 1000 Enter the type of transaction (w/d) : w Enter the amount: 150 New balance = $850 Continue (Y/n) ? y Enter the type of transaction (w/d): W Enter the amount: 75 New balance $775 Continue (y/n) ? y Enter the type of transaction (w/d) d Enter the amount 200 New balance = $975 Continne (Y/n) ? n Your final balance: $975 Goodbye! Ln: 57 Cot 4 1.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Windows
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage