Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

d. Code a while loop that keeps printing Cowabunga Dude! as long as the user enters 'Y' for the loop- control variable. Assume the loop-control

image text in transcribed

d. Code a while loop that keeps printing "Cowabunga Dude!" as long as the user enters 'Y' for the loop- control variable. Assume the loop-control variable, seeMovie, is already declared along with input for the Scanner class. The while loop requires a priming read for the loop-control variable before entering the loop. Create your own prompt for the loop-control variable. Code a while loop that determines and prints the winnings for the Davtona 500 depending upon the position after the finish-line: 1st, 2nd, or 3rd. i. Assume the input variable for the Scanner class, position and prizeMoney variables are already e. declared ii. Declare noWinners variable, and initialize it to the number ot winners. iii. Declare a counter-control variable for the while loop, and initialize it. iv. When the loop is entered, prompt: The driver crossed the finish line in which place? v. Insert the if-else structure from b into the while loop, and include code from. vi. Print the following according to the position number where the $Z,ZZZ,ZZ9 is the amount of the prize money. The Z's suppress the printing of leading zeroes and the 9 denotes printing of any number from 0-9: 1st place: You're the first place winner and you get $Z,zZZ,ZZ9! 2nd place: You're the second place winner and you get $Z ZZz,zz9! 3rd place: You're the third place winner and you get $Z,ZZZ,Zz9

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