Whenever you cook eggs for breakfast, you must decide how many eggs to use. You like to
Question:
Whenever you cook eggs for breakfast, you must decide how many eggs to use. You like to use this rule of thumb—use approximately one and a half eggs per person. Of course, you can’t use half an egg, so, you round up. For example, if you have three people who want to eat, you use five eggs.
Write a code fragment that prompts the user to enter the number of eaters, calculates the number of eggs required, and prints either “No one wants to eat.” (if the user enters a nonpositive value) or “Go to the Waffle House!” (if the user enters a value greater than 3) or “Use number-of-eggs eggs.”, where number-of-eggs is the number of eggs needed to feed the specified number of eaters.
Step by Step Answer:
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean