h5fncts.cpp
//Programmer: Price date: 3-16-14
//file: h5fncts.cpp
//Purpose: this file contains the definitions of the functions used in the
// fruit-rolling race predicting stupid sorta program.
#include <string>
#include "h5.h"
#include <iostream>
using namespace std;
void greet()
{
cout<<"\n\n\n\tWELCOME "<<USER<<" TO THE RACE PREDICTER PROGRAM"<<endl<<endl;
return;
}
void get_fruit_names(string & f1,string & f2)
{
cout<<"\n\tPlease enter first fruit name: ";
cin>>f1;
cout<<"\n\tPlease enter second fruit name: ";
cin>>f2;
return;
}
void get_fruit_wts(float & wt1, float & wt2)
{
do
{
cout<<"\n\tEnter wt of first fruit(not to exceed "<<MAX_FRUIT_WT
<<" lbs: ";
cin>>wt1;
} while (wt1 <= 0 || wt1 > MAX_FRUIT_WT);
do
{
cout<<"\n\tEnter wt of second fruit(not to exceed "<<MAX_FRUIT_WT
<<" lbs: ";
cin>>wt2;
} while (wt2 <= 0 || wt2 > MAX_FRUIT_WT);
return;
}
void judge_race(const string name1,const float wt1, const string name2,const
float wt2)
{
string winner = name2;
float heavier = wt2;
if (wt1 > wt2)
{
winner = name1;
heavier = wt1;
}
cout<<"\n\n\t\tAND THE WINNER ISSSSS....."<<endl;
cout<<"\n\n\t\t"<<winner<<" weighing "<<heavier<<" lbs!!!"<<endl<<endl;
return;
}
void goodbye()
{
cout<<"\nTHAT'S ALL FOLKS ...................."<<endl<<endl;
return;
}