Using Pythong, Stage I: For this stage, your program will keep track of the room
ID: 3764104 • Letter: U
Question
Using Pythong,
Stage I: For this stage, your program will keep track of the rooms that are available. This stage implements four commands, as described below. On each command line, the first two non-whitespace characters are the command; command letters may be upper or lower case.
NB
(for "add a new bedroom") followed by an integer room number (in the range 1–999). Add a new bedroom with the specified room number.
LB
(for "list bedrooms"). Print a list of the bedrooms currently available. The input file may contain any number of these commands in any order; each LB command prints a list of available bedrooms based on what has been added as of that point. See the sample output below for the format of the printed bedroom list. For this stage, it doesn't matter what order the bedrooms appear in.
PL
(for "print line"), followed by any text. Simply print (or "echo") a line, copying the input (not counting the PL and leading whitespace) to the output. You'll find it useful in testing, and it's also a simple way to make the program's reports clearer or fancier.
##
Comment, followed by any text. Like comments in a program, comment lines don't have any effect on the program's behavior; they just serve as annotations in the command file.
Below is a sample input file for this stage.
From this input file, your program should produce the following output:
Explanation / Answer
Complete Program:
Input file: commands.txt
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.