1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xeze [42]
2 years ago
13

arrange the following lines to make a program that determines when the number of people in a restaurant equals or exceeds 10 occ

upants. 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.
Computers and Technology
1 answer:
kkurt [141]2 years ago
5 0

Using the knowledge of computational language in python it is possible to write a code that program that determines when the number of people.

<h3>Writting the code:</h3>

<em> public static void main(String[] args) {</em>

<em>        Scanner scnr = new Scanner(System.in);</em>

<em>        int maxNumPeople = 10;</em>

<em>        int totalNumPeople = 0;</em>

<em>        while (totalNumPeople < maxNumPeople) {</em>

<em>            if (totalNumPeople < 0) {</em>

<em>                totalNumPeople = 0;// we are using line number 10 to check is the total number is less than zero if yes then assign totla number to 0</em>

<em>            }</em>

<em>            try//we are using line number 8 </em>

<em>            {</em>

<em>                totalNumPeople += scnr.nextInt();//line number 11 to get the number from user and add it to total number</em>

<em>                System.out.println("Occupancy: " + totalNumPeople);//using line 3 to display the number of occupants</em>

<em>            } catch (InputMismatchException e)//using line number 1</em>

<em>            {</em>

<em>                scnr.next();//use line 4 to discard the single string</em>

<em>                totalNumPeople += scnr.nextInt();//get the next int</em>

<em>                 System.out.println("Occupancy: " + totalNumPeople);</em>

<em>            }</em>

<em>        }</em>

<em>        System.out.println("We're full!");</em>

<em />

<em>    }</em>

See more about python at brainly.com/question/18502436

#SPJ1

You might be interested in
Can someone taught me? How to use this brainy apps la?​
Anna11 [10]
Okeh, So it basically helps you find answers for you homework and stuff and you can also answer people questions too and get points. You can get brainliest answer too. You can answer fake questions too but then you can be reported and the will delete your account
6 0
4 years ago
When starting a computer running Windows Vista, a technician sees that the error message "BOOTMGR is missing" appears after the
docker41 [41]

Answer:

B and C

Explanation:

Possible solution to solving "BOOTMGR is missing" error in Windows Vista is to use the Windows Recovery Environment.

Another option is to run "bootrec/fixboot" command from the comman prompt and the command prompt is also accessible from the windows recovery environment.

8 0
3 years ago
Which key toggles between insert mode and overtype mode?
andrew-mc [135]
The keyboard key that toggles between insert mode and overtype mode is the INSERT key.
7 0
3 years ago
Computers automatically name the main hard drive the_____ drive?
telo118 [61]

Answer:

Im not entirely sure but I think this is disk drive

Explanation:

6 0
3 years ago
A ____ is several programs simultaneously processing the same I/O stream.
Sonja [21]
Concurrent multiple program execution, opposite to pipeline execution where it needs to in a sequential or in order of execution. You can also say parallel process programming.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Wich type of operating system is usually used in personal computers
    6·2 answers
  • Which option will Joan use to get a glimpse of how her presentation will look when she presents it to her audience? Joan will us
    14·2 answers
  • Derek is working at the help desk when he receives a call from a client about an issue with the company's email. The customer is
    9·1 answer
  • When the _____ logical operator is used to combine keywords, a search engine will retrieve all results containing either keyword
    7·2 answers
  • A school principal trying to find out if parents will help buy new playground equipment shows digital leadership by.
    8·2 answers
  • Which symbol would be used in a flowchart to represent a connection to another part of the flowchart on the same page
    15·1 answer
  • What is the usual price of smartphone apps?
    8·2 answers
  • What is Colby Knox known for?
    15·2 answers
  • What are five don’ts of using a computer
    8·2 answers
  • 30 POINTS FOR THE CORRECT ANSWER
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!