Question: IN JAVA PLEASE 7) Eggs are are sold by the flat (30 eggs), by the dozen (12 eggs) or by the half dozen (6 eggs).

IN JAVA PLEASE

IN JAVA PLEASE 7) Eggs are are sold by the "flat" (30

7) Eggs are are sold by the "flat" (30 eggs), by the dozen (12 eggs) or by the half dozen (6 eggs). Suppose they cost 6.50 per flat, 3.00 per dozen, and 2.00 per half dozen for regular eggs, and 20% more for brown eggs. Write an interactive program (with a main() method) that prompts the user to enter a number of eggs, indicate by typing "yes" or "no" whether they are brown, and then prints out the number of flats, dozens, and half dozens that should be purchased to get at least that number of eggs for the lowest price, followed by the price. (Don't worry about formatting the decimal places.) A sample interaction might be like this user's response is in bold): How many eggs? 100 Do you want brown eggs (yeso)? yes 3 flats 1 dozens O half dozens Price 27.0

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!