Case Study: Determining a Grade on the KTU Scale
This is sample problem 5 in the syllabus, and it appears in some form in most past papers. The syllabus asks for it using both if-else and case structures, which is deliberate — comparing the two is the actual lesson.
The official scale
From the APJ Abdul Kalam Technological University B.Tech Academic Regulations 2024, clause R 7.21:
| Grade | Grade Point | % of total marks in the course |
|---|---|---|
| S | 10 | 90% and above |
| A+ | 9.0 | 85% and above but less than 90% |
| A | 8.5 | 80% and above but less than 85% |
| B+ | 8.0 | 75% and above but less than 80% |
| B | 7.5 | 70% and above but less than 75% |
| C+ | 7.0 | 65% and above but less than 70% |
| C | 6.5 | 60% and above but less than 65% |
| D | 6.0 | 55% and above but less than 60% |
| P | 5.5 | 50% and above but less than 55% |
| F | 0 | Below 50% overall (CIE + ESE), or below 40% in ESE |
Two further grades exist that are not mark-based: FE (failed eligibility, or failed a CIE-only course) and Ab (absent). Neither can be determined from a percentage, so neither belongs in this algorithm.
Check this against the current regulations before relying on it. Grade scales are amended between schemes, and several websites publish outdated or incorrect versions of this table.
What makes this problem interesting
Look at the boundaries: 90, 85, 80, 75, 70, 65, 60, 55, 50.
They step by 5, not 10. That single fact decides which structure fits, and it's what the exercise is really testing.