0% found this document useful (0 votes)
29 views7 pages

C Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views7 pages

C Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Yarmouk University

Hijjawi Faculty for Engineering Technology


Department of Computer Engineering
CPE150 – Introduction to Programming Laboratory
Lab Project

Course Management System


Course Management System is a program that allows instructors to manage materials, assignments, communications and other aspects of instruction for their
courses. You are to implement the part of that program that allows instructors to insert students marks and view some course statistics.

To implement your program, follow the instructions below:


Add a header (.h) file and two source (.cpp) files to your project. Write the prototypes in the .h file and the implementation and main in the other .cpp files.

Assumption: We’ll assume that the maximum number of students registered in a course = 20.

1. Variables Needed in main:


- Four arrays of integers that represent the first, second, final and total marks of the student. Initialize these arrays with zero.

- 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.

Initialize this array with spaces. Hint: {' '}

- 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.

Eng. Ameera Almomani


• int Dropped (char Status [], const int size);

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.

• void drawLine (int num);

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.

Description of each option:

1. Insert Student Info:


If the current number of students <20 then do the following, otherwise print an error message to the user:
Ask the user to insert the id, first, second and final marks of the student.
Check the validity of the marks:
If any of the first or second marks > 25, then show error message to the user.
If the final mark > 50, then show error message to the user.
Otherwise, store id and marks in the appropriate arrays and store the sum of all marks into the total array, then increment the current number of
students. Note: the current number of students serves as index to your arrays. See the graphical description below.

Eng. Ameera Almomani


2. Assign Dropped Student:
Ask the user to insert the id of the student.
Get the index of the student, if exist change his/ her status to 'D' in the status array.
Print suitable message to the user either ways.

3. View Course Report:

Print the course report that contains the following information:

Print a summary info that contain:


Total number of students.
Number of Dropped students.
Number of Passed students (in total grade).
Number of Failed students (in total grade).

Then print a detailed report contains the following information for all students as a table.

Status ID First Grade Second Grade Final Grade Total Grade

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:

Choice 1: Successful run Choice 1: when wrong grade entered

Eng. Ameera Almomani


Choice 2: Successful run

Choice 2: when student not found

Example for Choice 3 after Entering the info for 10 Students:

Eng. Ameera Almomani


Eng. Ameera Almomani

Best of Luck

You might also like