( Latest Revision: Oct 06, 2011 )

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 information that tells 
          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-800, 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 PrintInfo.

   //  Call function GetScore, to obtain a value for score1.

   //  IF score1 is out of range, print an error message.

   //   ELSE 

   //         Call GetScore a second time, to obtain a value for score2.

   //         IF score2 is out of range, print an error message.

   //         ELSE, using a call to function maximum within a cout
   //         statement, print the maximum score.

   return 0;
}

/* ================================== */
/*       FUNCTION DEFINITIONS         */
/* ================================== */


/* ================================== */
void PrintInfo(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 */
}
/* ================================== */