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 ;
/* ================================== */
/* FUNCTION DECLARATIONS (PROTOTYPES) */
/* ================================== */
void PrintHowTo(void);
/* Print instructions that tell what the program does. */
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-600, inclusive. */
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 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 DEFINITIONS */
/* ================================== */
/* ================================== */
void PrintHowTo(void)
{
cout << endl ;
cout << "This program interactively reads two quiz";
cout << endl ;
cout << "scores and prints the maximum.";
cout << endl ;
cout << endl ;
}
/* ================================== */
/* ================================== */
int GetScore(void)
{
/* stub for GetScore */
}
/* ================================== */
/* ================================== */
bool RangeError(int score)
{
/* stub for RangeError */
}
/* ================================== */
/* ================================== */
int maximum(int x, int y)
{
/* stub for maximum */
}
/* ================================== */