Question: In Java CHAPTER 7 EXERCISES 205 24 Write a program that supports the following dialog with the user: Enter quantity: 75 You have ordered 75

 In Java CHAPTER 7 EXERCISES 205 24 Write a program thatIn Java

CHAPTER 7 EXERCISES 205 24 Write a program that supports the following dialog with the user: Enter quantity: 75 You have ordered 75 ripples$19.50 Next customer (y): y Enter quantity: 97 Ripples can be ordered only in packs of 25. Next customer (y): t Next customer (y): n Thank you for using Ripple Systems. If, in response to the "Next customer" prompt, the user presses or enters anything other than a 'y' or an 'n', the program should repeat the prompt. Define the unit price of a ripple as a constant equal to 26 cents. Hints: Use the following statement to display the quantity ordered and the total dollar amount of the order: System.out.print f("You have ordered quantity, price quantity) %d Ripples $%.2f ". _ Use the following statements to read the quantity ordered and the user response to the "Next customer?" prompt: Scanner keyboard new Scanner (System.in) char answer int quantity keyboard.nextInt O: keyboard.nextLine): skip the rest of the line String str- keyboard.nextLine ).trimO; if (str.length O1) answer -str.charAt (0) else anawer

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!