Source Code for Lab #4
//
// LAB04.cpp. This program reads two quiz scores
// (between 0 and 600) for a student and prints the maximum
//
#include <iostream>
using namespace std ;
int main(void)
{
void PrintHowTo(void); // prototypes
int GetScore(void);
int RangeError(int score);
int maximum(int x, int y);
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 read a score interactively and return the score to the caller.
*/
int GetScore(void)
{
/* stub for GetScore */
}
/*
Function to return TRUE (1) if the quiz score (input) is out of range,
FALSE (0) otherwise. Range: 0-600
*/
int 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 */
}