Question: Practice on Selecting the Appropriate Loop in Java: 1.) Scenario You go to an arcade with 20 tokens, and each game costs 2 tokens. What

Practice on Selecting the Appropriate Loop in Java:

1.) Scenario You go to an arcade with 20 tokens, and each game costs 2 tokens. What loop should you use, and why?

2.) Scenario You go to an arcade with 100 tokens, and each game costs a variable number of tokens. What loop should you use, and why?

3.) Scenario You go to an all-you-can-eat buffet. You are trying to eat only until you are no longer hungry. What loop should you use, and why?

4.) Scenario It is Saturday night, and you are watching the Lottery draw for Fantasy Five. You get inspired to write a program to generate 10 lotto tickets, each ticket has 5 Lotto numbers. What loop should you use, and why?

5.) Scenario You are playing a guessing game with your little cousin. She wants you to guess her favorite color. What loop should you use for that, and why?

Write a program to demonstrate #1 - 5. These loops are required to be written in 1 program, worth 50 points per loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!