Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301 Data Structures Assignment No. 2 Solution and Discussion Fall 2014
#1

CS301 Data Structures Assignment No. 2 Solution and Discussion Fall 2014 Due Date: Dec 08, 2014


Uploading instructions

For clarity and simplicity, you are required to Upload/Submit only .cpp file.
Objective

The objective of this assignment is:

To make you understand the practical implementation of queue data structure.
Problem Statement:

Suppose in a Hospital, there are two physicians to deal with patients. Patients of all ages come for their check up. Physician ‘A’ is designated as physician of old patients while physician ‘B’ has to check other patients. Many patients come to the hospital at the same time. There are two queues of patients against each physician. If patient is an old man, he will stand in second queue; otherwise he will stand in first queue. Both doctors check their patients one by one on first come first served basis. Due to timing restriction of the hospital, each doctor can check a maximum of 20 patients per day.

You are required to write a program in C++ to implement the above scenario. It should be clear that patients will be added on back/rear side of the queue and will be served from front of the queue. Further, your program should use array to implement above scenario.

Model of one of the patients’ queues (array part) is given below.

[ATTACH=CONFIG]24256[/ATTACH]


Solution Guidelines:

You are required to implement queue as an array.
Your solution should contain two classes Patient class and PatientQueue class.
Patient class should be able to set patients’ information given in above model.
Further, your program should implement the following operations for PatientQueue class / data structure.
In main() function, you have to create two patient queues; one to store records of old patients, and one to store record of other patients.
Each queue should be populated based on age factor; for example if age is less than 50, patient should be added in first queue otherwise in second queue.
Add_Patient() : add new patient in the queue
Display_Patient_Phy1() : Show all Patients information treated by Physician A.
Display_Patient_Phy2() : Show all Patients information treated by Physician B.
Total_Patients() : Show the total number of patients served on a particular day.
Hint: Array index should hold Patient type object. In case of integer type array, you store an integer type data on array index. Here, as you have to store patient type data in array (queue), so patient object will be added on array index.



Sample Output:

For sample output, see the attached .GIF file.
[ATTACH=CONFIG]24257[/ATTACH]


Attached Files
.jpg   cs301.jpg (Size: 47.41 KB / Downloads: 930)
.jpg   CS301_Assignment_02_SampleOuuput.jpg (Size: 45.32 KB / Downloads: 922)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cs403 Assignment 3 Helping material May 8,2010 viki 1 5,196 04-28-2020, 03:19 PM
Last Post: ClaireBeauc
  cs301 assignment no 3 Solution 20 January 2016 Vuhelper 0 11,086 01-20-2016, 03:32 PM
Last Post: Vuhelper
  CS201 Assignment vo 3 Solution 20th January 2016 Vuhelper 2 2,594 01-20-2016, 03:28 PM
Last Post: Vuhelper
  CS101 Assignment no 3 Solution 20th January 2016 Vuhelper 0 2,278 01-20-2016, 03:25 PM
Last Post: Vuhelper
  SOC101 INTRODUCTION TO SOCIOLOGY assignment no 3 Solution 20 January 2016 Vuhelper 0 1,868 01-20-2016, 03:19 PM
Last Post: Vuhelper
  CS402 Assignment No 4 Solution & Discussion Xpert 0 2,093 08-01-2015, 02:33 AM
Last Post: Xpert
  cs101 Assignment No. 1 Solution 21 may spring 2015 semester Xpert 0 2,907 05-21-2015, 12:41 AM
Last Post: Xpert
  Assignment solution eng 301 due date 20 may 2015 rumesa khan 3 4,526 05-20-2015, 01:34 AM
Last Post: Xpert
  PHY301 Circuit Theory Assignment No. 1 idea Solution spring may 2015 semester Xpert 0 1,557 05-15-2015, 03:52 AM
Last Post: Xpert
  Assignment No. 01 Spring 2015 Information Systems CS507 idea solution spring 2015 Xpert 0 2,445 05-15-2015, 03:49 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)