In this assignment, we will look at a way to develop a students' registration system using C for some college. The goal of this program is to allow the administrators to register a student in offered courses, and also allows them to drop a course for a student.
This assignment is intended to get you to practice using arrays, pointers, functions, header files, user inputs, and formatting output among other things.
In this assignment we will have two arrays, one to store the student IDs, and the second is to store the course codes.
The student array must have at least 5 students, and the course code array must have at least 3 courses.
In addition, there will be a registration table, represented by two-dimensional array that will store the courses each student is registered in. This will be presented as a simple yes/no value stored in the registration table for each student using their index in the students array, and the course index in the courses array.
For example, if the system has three students with IDs {12345, 34567, 56789}, and have two courses with codes {"CST8234", CST8288}. Then the administrator can register a student with ID 34567 in a course with code CST8234 by recording Yes in the registration table for index 1 (representing the student index) and 0 (representing the course index).
The following illustrates the memory representation for of each of the arrays:
Address | Students Index | Value |
0x303300 | 0 | 12345 |
0x303304 | 1 | 34567 |
0x303308 | 2 | 56789 |
Address | Courses Index | Value |
0x308800 | 0 | CST8234 |
0x308809 | 1 | CST8288 |
Registration Table | |||
Index | Student Index | Course Index | Value 0 = no / 1 = yes |
0 | 0 | 0 | 0 |
1 | 0 | 1 | 1 |
2 | 1 | 0 | 1 |
3 | 1 | 1 | 1 |
4 | 2 | 0 | 1 |
5 | 2 | 1 | 0 |
Consequently, from the above table we can see that the student with index 0 (ID: 12345) is registered in course with index 1 (Code: CST8288) only.
Write a program that achieves the following requirements:
1) The program should prompt the user to enter:
2) Students should be stored in their own array.
3) The program then should prompt the user to enter:
4) Courses should be stored in their own array.
5) The program then should prompt the user to choose one of three actions:
6) If the user chooses to register a student or drop a student, then the program should prompt for the student ID first then the course code second and perform the correct ac- tion as follows:
7) If the user chooses to display the registration table, the program should print all entries in the table.
8) Additional requirements:
9) Make sure you use functions, design your program to separate functionality into its own functions. Using only main function will make you lose points.
10) Give your functions and variables a descriptive name. For example, students[], not x[].
11) Write a program that will implement ALL the requirements, explicit and implicit, listed above.
12) Each function must have a header comments that explain what it does, and describe/explain its inputs (if any) and return value (if any)
13) You must use a "makefile", with the CC_FLAGS set to -g -ansi pedantic Wall w), and OUT_EXE set to labAssessment#