0% found this document useful (0 votes)
13 views

Labsheet Queue and List

This document provides instructions for three programming exercises: 1) Create a queue of names and allow deleting names from the front, 2) Simulate a clinic queue with automatic token numbers and options to add/view/delete patients, and 3) Create a book price list that can display the most/least expensive, add prices to the front/back, and display the final list.

Uploaded by

MasterArvin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Labsheet Queue and List

This document provides instructions for three programming exercises: 1) Create a queue of names and allow deleting names from the front, 2) Simulate a clinic queue with automatic token numbers and options to add/view/delete patients, and 3) Create a book price list that can display the most/least expensive, add prices to the front/back, and display the final list.

Uploaded by

MasterArvin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

University of Mauritius

Department of Computer Science


CSE1018Y Computer Programming
Labsheeet : Queue & List

1. Write a program that creates a queue of Strings and allows


the input of an integer value n, followed by n names to be
placed in the queue. Then the program should execute a loop that
performs the following:
It displays the name in the front of the queue and asks the
user to specify a number of names to be deleted. The user
specifies a value and it deletes that number of names.
Each name deleted is displayed on the screen.
The two steps are continued until the queue is empty.
2. Patients in the out-patient department of a clinic are given
a token and requested to wait for their turns in a logical
queue. The token number is automatically generated. Write a
program to simulate the queue. Your program should display a
menu that allows you at any time to:
Insert a new patient in the queue.
View the name and token no. of the patient at the front of
the queue.
Delete a patient from the queue.
Find out how many patients are there in the queue.
3. Write a program that creates a list of book prices. The input
terminates when the user enters -1. Your program should perform
the following operations:

Display
Display
Add two
1500 to
Display

the most expensive book


the least expensive book
more book prices 1200 to the front of the list and
the back of the list.
the list

You might also like