CS1411 - Introduction to Programming Principles I

Programming / Lab Assignment 6

Warning: Starting this week there will be points deductetd if the assignmnent is not submitted in the correct format. Please see the submission guidelines!

Student management system

You are supposed to write a student management system. It will consists of the definition of a struct and some functions to manipulate and show student records. It will only need to support one student.

Do not use any global variables !

Define a struct called StudentRecord with the following fields: firstname, lastname (string), ssn, testnumber (whole numbers), grades (array of up to 20 integers), nrgrades (whole number). nrgrades should be used to keep track of how many grades were actually entered for this student.

Write an input function with this signature: void newStudent(StudentRecord &student) It should read in a students first and last name, ssn, and testnumber and initialize nrgrades to 0.

Write an output function void printStudent(StudentRecord student) It should output the students name, ssn, testnumber and all grades.

Write an output function void postGrade(StudentRecord student) It should output the students testnumber, and the average numeric grade (whole numbers only). If the student does not have any grades output "XXX" as grade.

Write an output function void printName(StudentRecord student) It should output the first letter of the first name in all uppercase, then a space, then the last name in all uppercase (book chapter 9).

Write a function void addGrade(StudentRecord &student) It should ask for a new grade and add it to the existing ones.

Use a main function simlar to the following to test your program. You may use a different main function if all the functionaluty can be tested with it:

int main()
  StudentRecord student;
  newStudent(student);
  printStudent(student);
  printName(student);
  postGrade(student);
  addGrade(student);
  addGrade(student);
  postGrade(student);
  return 0;
} 

Your programs should include comments whith you name, testnumber, etc. in the top. See also the Submission guidelines

The assignment is due Friday Oct 15, 6pm. You have to submit it electronically as stated in the submission guidelines!

Lost? See the Help! page.