Lab 10

/2010_F18/wk10/lab10.cpp

The purpose of this lab is to practice function definitions and function calls that accept arrays as arguments. Also, to practice with objects by object instantiation and accessing member variables. In this lab you will define a structure definition called Student, which will contain a cstring for the student's name, and an integer array of size 3 called tests that will hold the values of that particular student's test scores.
You will write a user controlled looping program that will instantiate a Student object, prompt the user for the student's name, and enter the student's three test scores. The program will then display the student's name, followed by the three test scores, the average of the tests up to 1 decimal point, and the corresponding letter grade.

Then ask the user to type in the full word "yes" if the user wishes to enter another student (then repeat), otherwise end the loop and let the program close.

Define and use the following functions with in your program:

#include<iostream>// cin cout
#include<cstring> // strlen strcpy strcat strcmp
#include<iomanip> // setprecision fixed showpoint setw
using namespace std;

#define MAX 32
#define MAX_TEST 3

// Student Structure Defintion
struct Student{     // Access member var --  obj.memberVariable
    char name[MAX];        // member variable
    int tests[MAX_TEST];   // member variable
};

// function prototypes
//
//

int main() {

    char response[MAX];

    Student stud;
    do{
      stud = getStudent();
      displayStudent(stud);

      cout << "Enter another student? \"YES/NO\": ";
      cin.getline(response,MAX);
    }while( /* Logic to compare string
               values of response and "YES" || "NO" */ );

    cout << endl;
    return(0);
}

// function definitions
//
//

Show me your completed code or submit via directory