hw5.h

// Programmer: Jennifer Leopold date: September 25, 2014

// File: hw5.h

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

// that will calculate various health functions as

// selected from a menu.

#ifndef H5_H

#define H5_H

using namespace std;

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

// Constants

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

const string MACHINE_NAME = "Dr. Eloe's Health-o-Matic";

// Constant used in calculating body mass index (BMI)

const short BODY_MASS_INDEX_MULTIPLIER = 703;

// Constants used in computing creatinine clearance

const short CREATININE_CLEARANCE_YEARS = 140;

const short CREATININE_CLEARANCE_SERUM_DIVISOR = 72;

// Constants used in computing creatinine clearance

const short CORONARY_RISK_BMI_THRESHOLD = 30;

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

// 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();

// The bodyMassIndex function returns body mass computed

// based on parameter weight and height.

// Preconditions: parameters weight and height have value > 0

// Postconditions: body mass index is returned

float bodyMassIndex(const short weight, const short height);

// The creatineClearance function returns creatinine clearance

// computed based on age, weight, and serum creatine.

// Preconditions: parameters age, weight, and creatine have

// value > 0

// Postconditions: creatinine clearance is returned

float creatineClearance(const short age, const short weight,

const float serumCreatine);

// The coronaryRisk function returns coronary risk

// computed based on body mass index, heart disease pre-

// disposition, and pounds of bacon eaten.

// Preconditions: parameter body mass index has value > 0,

// heartDiseasePredisposition is true or false, and

// poundsBaconEaten is >= 0

// Postconditions: coronary risk is returned

float coronaryRisk(const float bodyMassIndex,

const bool heartDiseasePredisposition,

const short poundsBaconEaten);

// The totterIndex function returns totter index

// computed based on length of the left and right legs.

// Preconditions: parameters leftLegLength and rightLegLength

// are >= 0

// Postconditions: totter index is returned

float totterIndex(const float leftLegLength,

const float rightLegLength);

// The promptForNonNegativeFloat function asks the user to enter

// a value for whatever the specified prompt is

// Preconditions: prompt parameter should specify what is being

// asked for (e.g., "weight")

// Postconditions: float value >= 0 is returned

float promptForNonNegativeFloat(string prompt);

// The promptForNonNegativeOrZeroFloatfunction asks the user to

// enter a value for whatever the specified prompt is

// Preconditions: prompt parameter should specify what is being

// asked for (e.g., "weight")

// Postconditions: float value > 0 is returned

float promptForNonNegativeOrZeroFloat(string prompt);

// The promptForNonNegativeShort function asks the user

// to enter a value for whatever the specified prompt is

// Preconditions: prompt parameter should specify what is being

// asked for (e.g., "weight")

// Postconditions: short value > 0 is returned

short promptForNonNegativeShort(string prompt);

// The promptForNonNegativeOrZeroShort function asks the user

// to enter a value for whatever the specified prompt is

// Preconditions: prompt parameter should specify what is being

// asked for (e.g., "weight")

// Postconditions: short value >= 0 is returned

short promptForNonNegativeOrZeroShort(string prompt);

// The promptForBool function asks the user to enter

// a value for whatever the specified prompt is

// Preconditions: prompt parameter should specify what is being

// asked for (e.g., "feelings of sadness")

// Postconditions: bool value (true or false) 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