/*
(
Latest Revision:
Mar 26, 2015
)
Source Code for Lab #5
*/
/*
LAB05.cpp. This program reads two quiz scores
(between 0 and 800) and prints the maximum
*/
#include <iostream>
using namespace std ;
/* ================================== */
/* FUNCTION DECLARATIONS (PROTOTYPES) */
/* ================================== */
void PrintInfo(void);
/* This function prints the following 4-line message,
(The first and last lines of the message are blank lines.)
This program interactively reads two quiz
scores and prints the maximum.
*/
int GetScore(void);
/* Prompt for a score (an int), read it & return it. */
bool RangeError(int score);
/* Return true if score is out of range,
else return false.
The range is 0-800, inclusive. */
void PrintErrorMsg (void) ;
/* This function prints the following 5-line message,
(The first and last lines of the message are blank lines.)
You entered an invalid score.
Scores must be in the range 0-800 (inclusive).
Please try again.
*/
int maximum(int x, int y);
/* Return the maximum of x and y */
/* ================================== */
/* ================================== */
int main(void)
{
int score1, // score #1
score2; // score #2
// Call function PrintInfo.
// Call function GetScore, to obtain a value for score1.
// IF score1 is out of range, call function PrintErrorMsg
// ELSE
// Call GetScore a second time, to obtain a value for score2.
// IF score2 is out of range, call function PrintErrorMsg
// ELSE, using a call to function maximum within a cout
// statement, print the maximum score.
return 0;
}
/* ================================== */
/* FUNCTION DEFINITIONS */
/* ================================== */
/* ================================== */
void PrintInfo(void)
{
cout << "\nThis program interactively reads two quiz\n";
cout << "scores and prints the maximum.\n\n";
}
/* ================================== */
/* ================================== */
int GetScore(void)
{
/* stub for GetScore */
}
/* ================================== */
/* ================================== */
bool RangeError(int score)
{
/* stub for RangeError */
}
/* ================================== */
/* ================================== */
void PrintErrorMsg (void)
{
cout << "\nYou entered an invalid score.\n";
cout << "Scores must be in the range 0-800 (inclusive).\n";
cout << "Please try again.\n\n";
}
/* ================================== */
/* ================================== */
int maximum(int x, int y)
{
/* stub for maximum */
}
/* ================================== */