hw6.cpp
// Programmer: Jennifer Leopold date: October 4, 2014
// File: hw6.cpp
// Purpose: This program will determine the presence of a
// disease (Jejunal Hemorrhage Syndrome) by
// calculating the various tests based on protein
// data supposedly obtained from a foreign organism
// having been introduced into the user's body.
// The process can be repeated for multiple users
// until the program is instructed to quit.
//
// To compile: fg++ hw6.cpp hw6fncts.cpp -o hw6
//
// To execute: ./hw6
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
#include "hw6.h"
using namespace std;
int main()
{
string patientName; // patient's name
proteinData collectedData; // patient's protein data
bool successfulDataCollection; // false if data collection
// for some protein failed
// Seed the random number generator
srand(time(NULL));
// Continue processing users until told to quit
do
{
// Greet user and get name
greet();
cout << "Enter your name (no spaces): ";
cin >> patientName;
// Obtain protein data
successfulDataCollection = getProteinData(collectedData);
outputProteinData(collectedData);
// If protein data collection was successful, determine
// (and output) disease prognosis
if (successfulDataCollection)
{
cout << patientName << ", here is your diagnosis: \n";
cout << "You do" <<
(determinePrognosis(collectedData)? "" : " not")
<< " have Jejunal Hemorrhage Syndrome!\n\n";
}
else
{
cout << "Sorry, " << patientName << "...\n";
cout << "There was a problem with the data "
<< "collection.\nI'm unable to make a "
<< "diagnosis!\n\n";
}
} while (promptForBool("\nProcess another patient?"));
// Sign off
goodbye();
return 0;
}