hw6.h

// Programmer: Jennifer Leopold date: October 4, 2014

// File: hw6.h

// Purpose: This file contains the header info for the program

// that will diagnose Jejunal Hemorrhage Syndrome.

#ifndef H6_H

#define H6_H

using namespace std;

// ***********************************************************

// Constants

// The name of the system with which the user interacts

const string PROGRAM_NAME =

"Dr. Eloe's Jejunal Hemorrhage Syndrome Diagnostic System";

// Message to output if certain protein data not collected

const string COLLECTION_ERROR = "unable to collect\n";

// Constants used for determining limit on random #'s for

// each protein (p1..p5)

const short MAX_VAL_FOR_P1 = 101;

const short MAX_VAL_FOR_P2 = 101;

const short MAX_VAL_FOR_P3 = 11;

const short MAX_VAL_FOR_P4 = 41;

const short MAX_VAL_FOR_P5 = 11;

// Percent of time tone is not heard

const short HOW_OFTEN_TONE_NOT_HEARD = 5;

// ***********************************************************

// Type declarations

struct proteinData

{

short p1; // the 5 different proteins being tested

float p2;

short p3;

short p4;

short p5;

};

// ***********************************************************

// Function prototypes

// The greet function will output a greeting message

// to the user.

// Preconditions: None

// Postconditions: a message is output to the screen

void greet();

// Call the appropriate functions that will get the

// protein data.

// Preconditions: None

// Postconditions: Parameter 'collectedData' will have

// all field values assigned. Returned value will be

// true if all data was successfully collected; otherwise,

// false will be returned.

bool getProteinData(proteinData &collectedData);

// Output the values for all the proteins.

// Preconditions: Parameter 'pData' has had all fields

// assigned values.

// Postconditions: Values of the fields in parameter 'pData'

// have been output to the screen.

void outputProteinData(const proteinData pData);

// Randomly determine whether a tone was heard.

// Preconditions: Parameter 'tone' contains a string that

// identifies the tone supposedly played.

// Postconditions: If tone was not heard, message will be

// output to the screen and false will be returned; otherwise,

// true will be returned.

bool toneWasHeard(const string tone);

// Calls appropriate functions to get values for proteins

// when tone A is played.

// Preconditions: None

// Postconditions: Parameters 'p1', 'p2', and 'p3' will be

// assigned values.

void toneA(short &p1, float &p2, short &p3);

// Calls appropriate functions to get values for proteins

// when tone G is played.

// Preconditions: None

// Postconditions: Parameters 'p2' and 'p4' will be

// assigned values.

void toneG(float &p2, short &p4);

// Calls appropriate functions to get values for proteins

// when tone C is played.

// Preconditions: None

// Postconditions: Parameters 'p1', 'p4', and 'p5' will be

// assigned values.

void toneC(short &p1, short &p4, short &p5);

// Gets a random value for protein p1.

// Preconditions: None

// Postconditions: Returns a value for protein p1.

short getProteinP1();

// Gets a random value for protein p2.

// Preconditions: None

// Postconditions: Returns a value for protein p2.

float getProteintP2();

// Gets a random value for protein p4.

// Preconditions: None

// Postconditions: Returns a value for protein p4.

short getProteintP4();

// Determine whether or not someone has the disease based

// on given protein data.

// Preconditions: Parameter 'pData' contains values for

// all fields.

// Postconditions: Returns true if disease is present;

// otherwise, returns false.

bool determinePrognosis(const proteinData &pData);

// The promptForBool function asks the user to enter

// a value for whatever the specified prompt is

// Preconditions: prompt parameter should specify a yes/no

// question for what is being asked for (e.g., "Do you

// want to continue?")

// Postconditions: bool value (true for 'yes' or false

// for 'no') is returned

bool promptForBool(string prompt);

// The goodbye function will output an exiting message

// to the user.

// Preconditions: none

// Postconditions: a message is output to the screen

void goodbye();

#endif