Question: java program. please do all 4 1. [after 4.8 ] Whenever you cook eggs for breakfast, you must decide how many eggs to use. You

 java program. please do all 4 1. [after 4.8 ] 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
java program. please do all 4

1. [after 4.8 ] 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. 2. [after 4.3] Given this code fragment: Trace the code using either the short form or the long form. To help you get started, here's the trace setup. The third column is for switch's controlling expression. For the short form, you won't need the line\# column. [after 4.9] The following main method is supposed to print the sum of the Page 164 numbers 1 through 5 and the product of the numbers 1 through 5 . Identify the bug. Although not required, to test your answer, you are encouraged to enter your corrected code in a program and run it. public static vold main(String[] args) c 4. [after 4.10] Given this main method: Trace the code using the long form. To help you get started, here's the trace setup. The third column is for the switch expression's controlling expression. When evaluating a switch expression, under line\# provide both the line where the expression is evaluated and the line where that value is assigned, like this

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!