Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started