CPPForSchool.com: Flow of Control Set 1: Assignment 11

11. The marks obtained by a student in 5 different subjects are input by the user. The student gets a division as per the following rules:
Percentage above or equal to 60 - First division
Percentage between 50 and 59 - Second division
Percentage between 40 and 49 - Third division
Percentage less than 40 - Fail
Write a program to calculate the division obtained by the student.


This particular assignment was somewhat confusing due to a language/cultural barrier.  It has come to my attention that terms like "marks" are often used in India.  Unlike the American English alternatives like "GPA" or "Grades".  Nevertheless, once I was able to confirm the overall terminology, it was a matter of creating an algorithm that takes all of the marks and averages it out to determine division classification.

Below is the algorithm for determining the average.

average = (subject1 + subject2 + subject3 + subject4 + subject5) / 5

From there, I is a matter of creating conditional statements in order to classify which division it will fall under.




Below are screenshots confirming that the algorithms are working.  Also, I have included the sample output from the assignment for comparison.













Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 9

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8