Vous êtes sur la page 1sur 2

Assignment No.

02 (Graded) Total Marks: 20

SEMESTER Spring 2018
Due Date: 05 /28/2018
CS301- Data Structures


Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:

o The assignment is submitted after due date.

o The submitted assignment is other than .cpp file.
o The submitted assignment does NOT open or file is corrupted.
o The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions

o You will upload only .cpp file on LMS.


The objective of this assignment is:

o To make you understand the practical implementation of queue data structure.

For any query about the assignment, contact at cs301@vu.edu.pk


Marks: 20
Problem Statement:

A testing service planned to conduct a recruitment test for both male and female candidates. Two different
persons are assigned for the clearance of candidates in examination hall. Invigilator ’M’ will be assigned for male
candidates while Invigilator ’F’ will be assigned for female candidates. In both cases candidates will be served on
first come and first serve basis. Equal number of male and female candidates will appear in test and each
invigilator will verify 25 candidates for the test.


Write C++ program to implement the above scenario. Your program should use array to implement above
scenario. It should be clear that candidates will be added on rear side of the queue and will be served from front
of the queue

Solution Guidelines:

 Implement queue using array

 Use two classes named “Candidate” and “CandidateQueue”
 There will be candidate information Roll_No, Name, Gender and Last_Degree in “Candidate” class.
 recordInfo(): Record candidate information (details) into object of Candidate class
 CandidateQueue class should be used for save candidates into queue
 Create two objects of CandidateQueue class to make queue of male and female candidates.
 Create insertIntoQ() function to check the gender of candidate and insert into relevant queue
 Create makeQueue() method of queue class to insert candidates into queue.
 Create Display_ Invigilator_M( ) function to display all male candidates.
 Create Display_ Invigilator_F( ) function to display all female candidates
 To display candidates of a queue use removeFromQ() method
 Create Total_Candidates( ) function to display total number of candidates in both queues
 Each queue should be filled based on gender.
 In above instructions the term “function” refers to a method that is not member of any class. On the other
hand the term “Method” refers to a function that is part of a class.

Sample Output:

Note: Please see the attached Demo Video for the program output.

Lectures Covered: This assignment covers Lecture # 5-15

Deadline: Your assignment must be uploaded/submitted at or before 05/28/2018