Carleton University
Department of Systems and Computer Engineering
SYSC 2002 - Winter 2009

Assignment 1

Imagine that we want to check that students have the prerequisites for the courses that they are taking. We have a file containing student academic records (“students.txt”) and need only write a program that will:

  1. read in this information
  2. do the necessary prerequisite checking

You will be happy to hear that much of the work has been done for you. File “skeleton.cpp” contains most of the required program. It includes suitable structure declarations, a series of utility functions that facilitate working with grades, a function that looks after reading the information from the file and storing it in an array of structures, and a main function. All you need do is implement function “doPrerequisiteCheck”.

This function looks for students who are currently taking the course of interest (have an entry for the course with a grade of “CUR”) but who have not passed the prerequisite course (have either not taken it at all or do not have a passing grade). Utility function “isCurrent” makes it easy to test whether a grade is “CUR”, and utility function “isPassingGrade” makes it easy to determine whether a grade is a passing grade (i.e. one of “D-”, “D”, “D+”, and so on).

In implementing “doPrequisiteCheck” you may, if you wish, write and use additional functions. Indeed you are encouraged to do so. The model solution (which will be posted after the due date) uses two additional functions. You may not, however, modify the code provided in any way.

Your completed program should operate in exactly the same way as the sample executable supplied (“asst1.exe”). Note that, in addition to listing the students who do not have a prerequisite course, it outputs the total number of problems detected. Try running the sample executable against file “students.txt” and checking that students in 2002 have 1606, that students in 2101 have 1005, and that students in 2501 have 1005.

Call your program “students.cpp” and submit the entire file.

p.s. In addition to giving students some practice with structures, this assignment is a none-too-subtle reminder that ECOR 1606 is a prerequisite for SYSC 2002. If you have not passed ECOR 1606, you will be deregistered from SYSC 2002.

Updated: Wednesday, December 31st, 2008.