Question
Hello, this is C++ :D Your job is to write a program that would allow us to diagnose diseases based on a given symptom. [60]
Hello, this is C++ :D Your job is to write a program that would allow us to diagnose diseases based on a given symptom. [60] Feature #1: Display # of Diseases This will display the number of diseases in the system -- NOT the symptoms! Notice that diseases are in order in the file -- you can take advantage of this. Go through each disease in the system and whenever you see that the current records disease name is different than the previous records disease name, then increment a counter. At the end of the loop, counter will holds the number of diseases in the system, right? ;-) [60] Feature 2: # of Symptoms per Disease Report This will display how many symptoms are in the system for each d isease. [100] Feature 3: Diagnose This will ask user for a symptom and display all diseases that have that symptom. Here are the requirements: ? [20] File I/O: Make sure to properly read the data from diagnostic.txt at the very beginning of the program. ? [20] Class: Make sure to use a class. The class will need 2 fields. ? [20] Function: Make sure that each feature is in its own function. Loading the data should also have in its own function. ? [20] Indentation and Comments: Make sure that your program is indented and commented properly. Penalties: [-100] if you are using global variables [-100] if your program does not compile or crashes 1- Dislay Disease Count 2- Symptom Count by Disease 3- Diagnose 0- Exit What do you want to do: 1 There are 7 diseases in the database. 1- Display Disease Count 2- Symptom Count by Disease 0-Exit What do you want to do: 2 There are 3 symptoms for cold There are 4 symptoms for flu There are 5 symptoms for leukemia There are 2 symptoms for alzheimer There are 4 symptoms for celiac There are 2 symptoms for dehydration There are 1 symptoms for exzema 1- Dislpay Disease Count 2- Symptom Count by Disease 3- Diagnose 0- Exit What do you want to do: 3 What is your symptom? fatigue You may have leukemia. You may have celiac. 1- Display Disease Count 2- Symptom Count by Disease 3- Diagnose 0- Exit What do you want to do: 3 What isyour symptom? fever You may have flu. You may hhave leukemia. 1- Display Disease Count 2- Symptom Count by Disease 3- Dignose 0- Exit What do you want to do:
Diagnosic.txt: cold sneezingcold coughing cold achy flu fever flu sneezing flu coughing flu achy leukemia fever leukemia chills leukemia fatigue leukemia nosebleeds leukemia sweating alzheimer forgetfulness alzheimer confusion celiac diarrhea celiac vomiting celiac fatigue celiac constipation dehydration nausea dehydration dizziness eczema blister
(Code needs to be really really SImple)
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