Question
#include using namespace std; void login(); void signup(); void consult_doctor(); struct tmc_database { private: bool patient[100]; bool doctor[2]; public: tmc_database() { doctor[1] = true; doctor[0]
#include
void login(); void signup(); void consult_doctor();
struct tmc_database { private: bool patient[100]; bool doctor[2]; public: tmc_database() { doctor[1] = true; doctor[0] = false; patient[0] = 1; patient[5] = 1; } bool check_exist(char c) { int x = c - 'A'; if (patient[x]) return true; return false; void register_patient(char c) { int x = c - 'A'; patient[x] = 1; int check_doctor() { for (int i = 0;i > s; if (s.size() > 1 || s[0]90 { cout else { cout
} } } void signup() { cout > s; if(s.size()>1 || s[0]90) { cout System Introduction We consider as an example a TeleMedicine Consultation (TMC) service. A patient is being treated over an extended period of time for an illness that requires frequent tests and consultations with a doctor at the hospital to set the right doses of medicine. Since the patient may stay at home and the hospital is at a considerable distance away from the patient's home, the patient has been equipped with the necessary testing equipment at home, The patient can book appointments by contacting TMC reception desk for a consultation session with one of the doctors. The reception desk will assign an available doctor to the requesting patient. Telemedicine sub-systems Signup system A patient wants to get registered to a Telemedicine Consultation (TMC) system to request doctor appointments. The TM system asks the patient to signup. The signup service asks the patient to propose a login ID. If the proposed login ID does not already exist, the patient is notified that you are now registered to the Telemedicine system. If the patient login ID already exists the system asks the patient to choose another ID. The signup service again checks if the ID already exists and so on. There is no limit for re- choosing an ID for signup. After successful registration the patient is asked to Login for doctor appointments. Login system If the patient is already registered to the TMC system, the system asks the patient to login. The login service asks the patient to enter the Login ID. . If the patient enters wrong ID, he is prompted Wrong ID: re-enter correct ID. The patient can enter wrong ID only three times. The fourth wrong attempt prompts the patient "you are not a registered patient, please signup first. Consultation Service (Reception desk) - If the patient enters correct ID, the system asks the patient to "request a doctor. The TMC service will check if a doctor is available. If it is available the patient is assigned a doctor and prompted "Doctor no. 1 is about to contact you". The prompt can be "Doctor no. 2 is about to contact you", if Doctor no. 1 is already assigned to another patient. If a doctor is not available, the patient is prompted "Sorry! No Doctor available". Take care of the following: Use arrays to register patients. Initialize array with at least two already registered patients. Patient IDs are simple characters (Single characters like 'A' and 'B'). IDs other than alphabets are not allowed. Invalid inputs must be warned. Assume maximum two doctors. Meaning that the TMC system has only two doctors in its resource pool. Use an array initialized with two doctors having IDs 1 and 2. Your design should have at least three user-defined functions named signup, login and consultation. Bonus marks (between 2-8) will be given if the system is implemented using the concept of "Structures
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started