Source Code for Lab #4
//
// LAB04.cpp. This program reads two quiz scores
// (between 0 and 600) and prints the maximum
//
#include <iostream>
using namespace std ;
void PrintHowTo(void); // prototypes
int GetScore(void);
bool RangeError(int score);
int maximum(int x, int y);
int main(void)
{
int score1, // score #1
score2; // score #2
/* Call function PrintHowTo to print instructions */
/* obtain a value for score1 by calling GetScore */
/* if score1 is out of range print an error message */
/* else obtain a value for score2 by calling GetScore */
/* if score2 is out of range print an error message */
/* else using function maximum print maximum score */
return 0;
}
/* Function to print instructions on what the program does */
void PrintHowTo(void)
{
cout << endl ;
cout << "This program interactively reads two quiz";
cout << endl ;
cout << "scores and prints the maximum.";
cout << endl ;
cout << endl ;
}
/* Function to prompt for a score, read it,
and return the score to the caller. */
int GetScore(void)
{
/* stub for GetScore */
}
/* Function to return true if the quiz score (input) is
out of range, false otherwise. Range: 0-600 */
bool RangeError(int score)
{
/* stub for RangeError */
}
/* Function to return
the maximum of two integer parameters (x and y) */
int maximum(int x, int y)
{
/* stub for maximum */
}