Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Arrange the following lines to make a program that determines when the number of people in a restaurant equals or exceeds 10 occupants. The program

image text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

Arrange the following lines to make a program that determines when the number of people in a restaurant equals or exceeds 10 occupants. The program continually gets the number of people entering or leaving the restaurant. Ex: 2 means two people entered, and -3 means three people left. After each input, the program outputs the number of people in the restaurant. Once the number of people in the restaurant equals or exceeds 10 , the program exits. If an InputMismatchException exception occurs, the program should get and discard a single string from input. Ex: The input "2 abc 8" should result in 10 occupants. Not all lines are used in the solution. Mouse: Drag/drop Keyboard: Grab/release (or Move . Cancel Esc MaxOccupancyTracker.java Load default template... import java.util.Scanner; import java. util. InputMismatchException; public class Max0ccupancyTracker \{ public static void main(String [] args) \{ Scanner scnr = new Scanner(System. in); int maxNumPeople=10; int totalNumPeople =0; while (totalNumPeople

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

How would you define a service?

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago

Question

Explain the service recovery paradox.

Answered: 1 week ago