(In java) Lab6C: Cha-Ching For this lab, use a do-while loop. A sentinel loop is a loop (a special while loop or a do-while 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 or do-while loop. A good example of a sentinel loop is the while loop that you had to write to verify user input in Lab6B, the special values were anything in the range of 1 to 1000. Another very common application for this is allowing a user to rerun a program. Please write a very simple program that mimics a bank account. The program should start the user out with $1000. The program should print out a welcome menu once with 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. Remember, the class name should be Lab6C. 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 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: 500 Invalid entry, please try again. Would you like to return to the main menu (Y/N)? : Y  Page 6 of 6 Menu 0 – Make a deposit 1 – Make a withdrawal 2 – Display account value Please make a selection: 2 Your current balance is $1050 Would you like to return to the main menu (Y/N)? : N Thank you for banking with us!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

(In java) Lab6C: Cha-Ching For this lab, use a do-while loop.
A sentinel loop is a loop (a special while loop or a do-while 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 or do-while loop. A good example of a sentinel loop is the while
loop that you had to write to verify user input in Lab6B, the special values were anything in the range of
1 to 1000. Another very common application for this is allowing a user to rerun a program.
Please write a very simple program that mimics a bank account. The program should start the user out
with $1000. The program should print out a welcome menu once with 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.
Remember, the class name should be Lab6C.
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 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: 500
Invalid entry, please try again.
Would you like to return to the main menu (Y/N)? : Y
 Page 6 of 6
Menu
0 – Make a deposit
1 – Make a withdrawal
2 – Display account value
Please make a selection: 2
Your current balance is $1050
Would you like to return to the main menu (Y/N)? : N
Thank you for banking with us! 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Print statement
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education