•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 361,855 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,520 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 10380 | Replies: 2
![]() |
•
•
Join Date: Aug 2004
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Dear members,
I am self practicing C++ and I am interested to understand ADTs in C++. It became challenging to understand, but seems very interested. So for my clear understanding, I invite any member to assist me to understand the implementation of linked list using pointers in dynamic memory allocation in a very simple example of hospital system (just for my academic purpose). So the following is my problem of statement.
- A hospital has five Wards. Each ward has ten rooms. Each room has six beds. And each bed in each room has assigned a unique bed number.
- I need to keep two separate lists with the following information:
1. Admitted: Full Name, Age, Sex, Date Admitted, City, Telephone, and Remark
2.Treated: Full Name, Age, Sex, Date Sent Off, City, Telephone, and Remark
-A new admitted patient will be registered to his/her detail information on Admitted list
-A patient who gets treated and sent left the hospital has to deleted from the Admitted list and transferred to the Treated list
Based on the above info I need to create a linked list that perform the following operations:
-Initialize()
-IsEmpty()
-IsFull()
-SearchName(): Given the Name, searches for the ward, room and bed number of the patient
-SearchBed(): Given the bed number, room, and ward, searches for the name of a patient
-IsFree(): Test whether a bed is free in a given ward and room.
-Transfer(): Transfers a patient to another given ward, room, and bed number, given the current ward, room, and bed number of the patient
-Admit(): Inserts all the required information about a patient when admitted
-Treated(): Makes a bed free after a patient is treated and sent off from the hospital; and delete from Admitted list and adds to the list of treated
-ListFree(): List all the free beds in the hospital
-SearchTreated(): Given the name, searches for a treated and sent off patient
Please provide me a source code for above requirements including all the necessary definitions using structured C++ program language in very simple way.
Thank you all!
Yesuf Adane
I am self practicing C++ and I am interested to understand ADTs in C++. It became challenging to understand, but seems very interested. So for my clear understanding, I invite any member to assist me to understand the implementation of linked list using pointers in dynamic memory allocation in a very simple example of hospital system (just for my academic purpose). So the following is my problem of statement.
- A hospital has five Wards. Each ward has ten rooms. Each room has six beds. And each bed in each room has assigned a unique bed number.
- I need to keep two separate lists with the following information:
1. Admitted: Full Name, Age, Sex, Date Admitted, City, Telephone, and Remark
2.Treated: Full Name, Age, Sex, Date Sent Off, City, Telephone, and Remark
-A new admitted patient will be registered to his/her detail information on Admitted list
-A patient who gets treated and sent left the hospital has to deleted from the Admitted list and transferred to the Treated list
Based on the above info I need to create a linked list that perform the following operations:
-Initialize()
-IsEmpty()
-IsFull()
-SearchName(): Given the Name, searches for the ward, room and bed number of the patient
-SearchBed(): Given the bed number, room, and ward, searches for the name of a patient
-IsFree(): Test whether a bed is free in a given ward and room.
-Transfer(): Transfers a patient to another given ward, room, and bed number, given the current ward, room, and bed number of the patient
-Admit(): Inserts all the required information about a patient when admitted
-Treated(): Makes a bed free after a patient is treated and sent off from the hospital; and delete from Admitted list and adds to the list of treated
-ListFree(): List all the free beds in the hospital
-SearchTreated(): Given the name, searches for a treated and sent off patient
Please provide me a source code for above requirements including all the necessary definitions using structured C++ program language in very simple way.
Thank you all!
Yesuf Adane
•
•
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,330
Reputation:
Rep Power: 11
Solved Threads: 101
Have you tried to do any of this yourself?
I'm going to let this one stay, only because you're saying you're doing this for your personal enrichment, and not some homework assignment. If you really want someone to help you out, why not get a start on the program, and then post some code that you've written?
I'm going to let this one stay, only because you're saying you're doing this for your personal enrichment, and not some homework assignment. If you really want someone to help you out, why not get a start on the program, and then post some code that you've written?
Alex Cavnar, aka alc6379
•
•
Join Date: Jun 2004
Location: Marin, CA, USA
Posts: 434
Reputation:
Rep Power: 5
Solved Threads: 10
Some ideas....
1) Have you thought about only one list where you just have a boolean saying whether they are in the hospital now or not? That way you could say "where is Mary Smith" and look in the one list.
2) The list should probably be persisted to disk so you can come back to the program each time someone new enteres or someone old exits the system.
3) You don't list 'bed number' in your things you want to save about each customer.
4) Is there anything special about the beds? Are they all the same? No emergency room or special care?
5) No accounting for hours of stay or costs associated :-)
6) Maybe a 'time in' and 'time out' on the records, so you know WHEN someone was there?
Sorry, just thinking out loud....
1) Have you thought about only one list where you just have a boolean saying whether they are in the hospital now or not? That way you could say "where is Mary Smith" and look in the one list.
2) The list should probably be persisted to disk so you can come back to the program each time someone new enteres or someone old exits the system.
3) You don't list 'bed number' in your things you want to save about each customer.
4) Is there anything special about the beds? Are they all the same? No emergency room or special care?
5) No accounting for hours of stay or costs associated :-)
6) Maybe a 'time in' and 'time out' on the records, so you know WHEN someone was there?
Sorry, just thinking out loud....
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Similar Threads
- The C++ LINKED LIST (C++)
- Linked List (C)
- help with adding items to a linked list. (Java)
- Checking for duplicates in a orderedered linked list (C++)
- doubly linked list implementation (Java)
- Removing an item from head of linked list (C)
- Cannot figure out how to implement linked list and rbtree for a project! (Java)
- help by sorting a simply linked list (C)
Other Threads in the C++ Forum
- Previous Thread: c++ nesting loops
- Next Thread: incorrect output in Linux environment



Linear Mode