COSC 1337 - Programming Fundamentals II
Bob Comer, Professor of Computer Studies


Assignment 8 - Test Scores

Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class.

Input Data

For each student, the following data will be input:

Use a struct to hold the name and score for one student. The name should be storedin a C++ string object.

Validation

Processing

Your program should work for any number of students. When the program starts, it should ask the user for the number of students to be processed. Then it should dynamically allocate an array of that size (array of student/score structures).

The program should then:

Sample Output

Name                  Score
---------------------------
Jim Smith                75
Victor Montero           81
Christa Kim              88
---------------------------
Average                  81.3

Requirements/Hints:

  1. Global variables are variables that are declared outside any function. Do not use global variables in your programs. Declare all your variables inside functions
  2. Use the C++ string class to hold the student name.
  3. Use a struct to store student name/score pairs.
  4. Use a dynamically-allocated array of structs to store the information for a class.
  5. In at least one of your functions, you must declare the array parameter using pointer notation instead of array notation, and inside the function you must use pointer notation instead of array notation to access the array elements.


Return to Programming Fundamentals II Home Page

Copyright: ©2013 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to:
Bob Comer
Last updated: April 8, 2013