C Project
C Project
Assumption: We’ll assume that the maximum number of students registered in a course = 20.
- One array of integer that contains the IDs of the students. Initialize the array with zero.
- One array of character that represents the status of the student. A value of 'D' means the student dropped the course.
- An integer variable that represents the current number of students registered in the course. Initialize this variable with zero.
Note: All arrays have the same size that is 20 as assumed before, use a constant integer named size to represent that.
Eng. Ameera Almomani
2. Functions Prototypes and Description:
• int getStudent (int ID [], int id, const int size);
This function takes an integer array that represents the IDs of the students, integer number that represent the id to search for and the size of the array.
The function should return the index of the student with the same id passed to the function or return -1 if not found.
• int indexOfMax (int Marks [], char Status [], const int size);
This function takes an integer array that represents the marks of the students, a character array that represents the status of the student (D – Dropped)
and the size of the arrays. This function should return the index of the maximum mark excluding (without) the dropped students.
• int indexOfMin (int Marks [], char Status [], const int size);
This function takes an integer array that represents the marks of the students, a character array that represents the status of the student (D – Dropped)
and the size of the arrays. This function should return the index of the minimum mark excluding (without) the dropped students.
• double Average (int Marks [], char Status [], const int size);
This function takes an integer array that represents the marks of the students, a character array that represents the status of the student (D – Dropped)
and the size of the arrays. This function should return the average of the marks excluding (without) the dropped students.
• int Passed (int Marks [], char Status [], const int size);
This function takes an integer array that represents the marks of the students, a character array that represents the status of the student (D – Dropped)
and the size of the arrays. This function should return the number of passed students (i.e. students that have marks >= 50) excluding (without) the
dropped students.
• int Failed (int Marks [], char Status [], const int size);
This function takes an integer array that represents the marks of the students, a character array that represents the status of the student (D – Dropped)
and the size of the arrays. This function should return the number of failed students (i.e. students that have marks < 50) excluding (without) the
dropped students.
This function takes a character array that represents the status of the student (D – Dropped) and the size of the array. This function should return the
number of dropped students.
• int num_Range (int Marks [], char Status [], const int size, int high, int low);
This function takes an integer array that represents the marks of the students, a character array that represents the status of the student (D – Dropped),
the size of the arrays and tow integer numbers that represent the high and low marks in a range. The function should return the number of students
that have mark >= low and < high, excluding (without) the dropped students.
This function takes an integer and prints a horizontal line with the symbol '#' with same count as num.
3. In main:
- Define the variables previously mentioned in 1.
- Display the following menu to the user:
1. Insert Student Info.
2. Assign Dropped Student.
3. View Course Report.
4. Exit.
Then print a detailed report contains the following information for all students as a table.
Then below the first, second, final and total grades columns, print the following information for all grades:
Maximum
Minimum
Average
After that print a horizontal chart to summarize the ratings of the students in the total mark as described:
Each line in the chart has the following structure: Range Rating Count Chart Line with the symbol #
Ranges and ratings are:
90 – 100 Excellent
80 – 90 Very Good
70 – 80 Good
60 – 70 Acceptable
50 – 60 Week
< 50 Fail
4. Exit: Allows the user to exit the menu.
Eng. Ameera Almomani
4. Sample Run
Main Page:
Best of Luck