In: Computer Science
Using C language
The system that you will develop holds the personal information for a number of students and the information of the course each student is registered in. The assumption is that each student is registered in a single course only. But the system will have a number of students saved.
REQUIREMENTS:
In this lab, you will introduce a simple student records system, which will save the student information as well as a single course that the student is registered in. Firstly, the system should ask the user to enter the number of students they wish to save. Then the system should start asking the user to enter each student and course information. Keep in mind that the student information is to be presented in a struct, called Student, while the course information is presented in another struct, called Course. The Student struct will have a pointer reference to the Course struct variable that has the course information. Yet, the Course struct doesn’t hold any information about the student at all. Once the user enters all students and course information, the system must print out all information entered by the user for verification.
The following is a complete list of the system requirements:
1. Define a Student struct the holds the following information about each student:
1. First name, which is a string of length 19.
2. Last Name, which is a string of length 19.
3. Student ID, which is a 5-digit number.
4. A pointer to the course student registered in.
2. Define a Course struct that holds the following information about each course:
1. Course code, which is a 7-alphanumeric string.
2. Course name, which is a string of length 24.
3. Course struct must be a type defined unnamed struct.
4. The system should ask the user for the number of students they wish to save.
5. For each student, the system should prompt the user to enter their information (i.e. student information).
6. For the student’s course, the system should prompt the user to enter the course information.
7. Once all students and their courses are entered, the system must print all their information for the user verification.
//program #include <stdio.h> |
Screen shot of the program |
Screen shot of the output |
Please comment if any query