Write a Java program correctly that will prompt for and read 3 integer values guests, tables, and meals entered by the user. Determine the message(s) to display based on the specifications that follow. Note, there can be more than one category the user input satisfies. Be sure to use the same format and wording as in the sample runs in the table below. Using a combination of at most 3 if, else if or else to fulfill the requirements described below. 1. If the number of meals is greater than the number of tables and the number of guests is smaller than the number of meals, display Seems all guests will be served. 2. If the number of guests is greater than the number of tables and the number of meals is smaller than number of guests display the message Seems that not all the guests will be served. 3. If the number of guests is smaller than the number of meals and the number of tables is greater than the number of meals, display the message Seems that some tables will be empty.
Write a Java program correctly that will prompt for and read 3 integer values guests, tables, and meals entered by the user. Determine the message(s) to display based on the specifications that follow. Note, there can be more than one category the user input satisfies. Be sure to use the same format and wording as in the sample runs in the table below.
Using a combination of at most 3 if, else if or else to fulfill the requirements described below.
1. If the number of meals is greater than the number of tables and the number of guests is smaller than the number of meals, display Seems all guests will be served.
2. If the number of guests is greater than the number of tables and the number of meals is smaller than number of
guests display the message Seems that not all the guests will be served.
3. If the number of guests is smaller than the number of meals and the number of tables is greater than the number of meals, display the message Seems that some tables will be empty.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images