24.5k views
4 votes
A pseudocode program is started below that asks the user for input and stores the value in a variable. Continue writing pseudocode to accomplish this task:

If the hour is within the school day (8 to 15) then display “Nice to see you!”, Otherwise, display “It’s time to go home!


DISPLAY (“Enter the hour of day (0-23)”)

hour <- INPUT ()

User Strings
by
4.8k points

1 Answer

2 votes

Answer:

IF hour >= 8 AND hour <= 15

DISPLAY("Nice to see you!")

ELSE

DISPLAY("It's time to go home!")

END IF

Step-by-step explanation:

We check the value entered, and stored in the variable 'hour'.

If the value of 'hour' is greater or equal to 8, but lower or equal 15, we wish the student welcome. Otherwise, we tell him to go home. Then end of the IF structure.

This fragment of code would be placed below the one provided in the question statement.

User Xuehui
by
4.9k points