Data Structures CS301 Assignment No 2 solution and discussion - VULMS-Virtual University Of Pakistan

vulms

Some subjects are not on the menu, you can find by using the search box, for example "cs101"

Post Top Ad

Data Structures CS301 Assignment No 2 solution and discussion

CS301- Data Structures
Assignment No. 02(Graded)
SEMESTER Spring 2018

Instructions
Please read the following instructions carefully before solving & submitting an 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 CS301 Assignment No 2 only .cpp file on LMS.
Objective
The objective of this assignment is:
o   To make you understand the practical implementation of queue data structure.

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 the examination hall. Invigilator's’ 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.

Question:

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 the 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 the 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:
 CS301 Assignment No 2 Note: Please see the attached Demo Video for the program output.