This is a C++ question with multiple parts. Please read carefully. In this assig
ID: 656526 • Letter: T
Question
This is a C++ question with multiple parts. Please read carefully.
In this assignment, you will write a struct plus 2 simple classes and then write a program that uses all of them. The 1st class is a Date class. The 2nd is a Patient class. The program will keep track of patients at a walk-in clinic. For each patient, the clinic keeps a record of all procedures done. This is a good candidate for a class, but to simplify the assignment, you need to make a procedure into a struct. We will assume that the clinic has assigned all care providers (doctors, nurses, lab technicians) with IDs and each procedure (
Explanation / Answer
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int main()
{
vector<string> injuries(8);
vector<int> primes(8);
string name;
double employeeId;
double numberOfInjuries = 0.0;
int cases = 0;
int sumOfprices = 0;
injuries[0] = "Severe Abrasions and Bruising";
injuries[1] = "Cuts w/Stiches";
injuries[2] = "1st Degree Fractures";
injuries[3] = "2nd Degree Fractures";
injuries[4] = "Burn Treatment (all degrees)";
injuries[5] = "Severed Appendage (Fingers/Toes)";
injuries[6] = " Severed Appendages (Arms/Legs)";
injuries[7] = "Concussion";
primes[0] = 20;
primes[1] = 60;
primes[2] = 150;
primes[3] = 350;
primes[4] = 200;
primes[5] = 180;
primes[6] = 430;
primes[7] = 45;
cout << "Please enter the patient's first and last name: ";
getline(cin, name);
cout << "Please enter employee ID: ";
cin >> employeeId;
while (cases != 8)
{
cout << injuries[0] << " - Type '0' " << endl;
cout << injuries[1] << " - Type '1' " << endl;
cout << injuries[2] << " - Type '2' " << endl;
cout << injuries[3] << " - Type '3' " << endl;
cout << injuries[4] << " - Type '4' " << endl;
cout << injuries[5] << " - Type '5' " << endl;
cout << injuries[6] << " - Type '6' " << endl;
cout << injuries[7] << " - Type '7' " << endl;
cout << "No other injuries" << " - Type '8' " << endl;
cin >> cases;
if (cases > 8 || cases < 0)
{
cout << "Enter a valid number!" << endl;
cout << injuries[0] << " - Type '0' " << endl;
cout << injuries[1] << " - Type '1' " << endl;
cout << injuries[2] << " - Type '2' " << endl;
cout << injuries[3] << " - Type '3' " << endl;
cout << injuries[4] << " - Type '4' " << endl;
cout << injuries[5] << " - Type '5' " << endl;
cout << injuries[6] << " - Type '6' " << endl;
cout << injuries[7] << " - Type '7' " << endl;
cout << "No other injuries" << " - Type '8' " << endl;
cin >> cases;
}
sumOfprices = sumOfprices + primes[cases];
}
cout << sumOfprices << endl;
cin.sync();
getchar();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.