Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
In this capstone project for Chapter 12, we will integrate all conditional control flow techniques—including if-elif-else ladders, nested conditions, guard clauses, short-hand guards, and ternary expressions—to build a production-grade Academic Merit & Report Card Processing Engine.
Real-world grading systems (such as those used by CBSE, ICSE, or State Technical Universities) do not simply look at an aggregate percentage. They enforce multi-tiered academic regulations:
Our engine implements the standard Central Board 9-point relative/absolute grading taxonomy:
| Percentage Range | Letter Grade | Grade Point | Academic Classification |
|---|---|---|---|
| 91.0% – 100.0% | A1 | 10.0 | Outstanding (Top Honors) |
| 81.0% – 90.9% | A2 | 9.0 | Excellent |
| 71.0% – 80.9% | B1 | 8.0 | Very Good |
| 61.0% – 70.9% | B2 | 7.0 | Good (Above Average) |
| 51.0% – 60.9% | C1 | 6.0 | Average |
| 41.0% – 50.9% | C2 | 5.0 | Below Average |
| 33.0% – 40.9% | D | 4.0 | Marginal Pass (Passing Cutoff) |
| Below 33.0% | E | 0.0 | Needs Essential Improvement |
Here is the complete, runnable Python engine. It demonstrates clean guard clauses, nested verification trees, ternary expressions, and structured marksheet generation:
Let us pass diverse student profiles through the engine to test all conditional branches:
Output:
+====================================================================+ | DELHI PUBLIC SCHOOL / CBSE ACADEMIC TRANSCRIPT | +====================================================================+ Roll Number: DPS-2026-001 Candidate: Ananya Singhal Result Status: PROMOTED Attendance: 94.5% (REGULAR (Compliant)) Total Score: 482.0 / 500.0 Percentage: 96.40% Letter Grade: A1 (Grade Point: 10.0) Honors Category: GOLD MEDALIST (Dean's Roll of Honor) +--------------------------------------------------------------------+ +====================================================================+ | DELHI PUBLIC SCHOOL / CBSE ACADEMIC TRANSCRIPT | +====================================================================+ Roll Number: DPS-2026-002 Candidate: Vikramaditya Roy Result Status: DEBARRED Advisory: Debarred due to low attendance (61.0%). Minimum 75.0% required. +--------------------------------------------------------------------+ +====================================================================+ | DELHI PUBLIC SCHOOL / CBSE ACADEMIC TRANSCRIPT | +====================================================================+ Roll Number: DPS-2026-003 Candidate: Manish Tiwari Result Status: COMPARTMENT Percentage: 53.60% (Provisional) Advisory: Eligible for compartment supplementary examination in Mathematics. +--------------------------------------------------------------------+ +====================================================================+ | DELHI PUBLIC SCHOOL / CBSE ACADEMIC TRANSCRIPT | +====================================================================+ Roll Number: DPS-2026-004 Candidate: Sneha Kulkarni Result Status: PROMOTED Attendance: 68.0% (CONDONED (Medical Approved)) Total Score: 405.0 / 500.0 Percentage: 81.00% Letter Grade: A2 (Grade Point: 9.0) Honors Category: FIRST CLASS WITH DISTINCTION +--------------------------------------------------------------------+ +====================================================================+ | DELHI PUBLIC SCHOOL / CBSE ACADEMIC TRANSCRIPT | +====================================================================+ Roll Number: DPS-2026-005 Candidate: Farhan Akhtar Result Status: ESSENTIAL REPEAT Advisory: Failed in 2 subjects: Mathematics, Physics. Must repeat academic year. +--------------------------------------------------------------------+
failed_subjects). This permits counting the exact number of backlogs to differentiate between a single Compartment vs. an Essential Repeat.>= 91, >= 81, etc.). Because elif short-circuits upon the first match, no compound checks like 91 <= pct <= 100 are needed.90, 80, 70, etc.) when using if-elif-else ladders.Python requires consistent indentation (recommended: 4 spaces). Mixing tabs and spaces raises an IndentationError:
:)Every if, elif, and else statement must end with a colon:
if-elif-else ladder checking numerical grades, why should percentage thresholds be checked in descending order (e.g. >=90, then >=80, then >=70)?A. Because Python sorts elif statements automatically at runtime B. Because an elif block exits upon finding the first True condition; ascending order would cause 95% to trigger the >=40% check first C. Because Python raises an IndentationError if numerical comparisons are not in order D. Descending order is required by the PEP 8 linter
A. Singleton Pattern B. Guard Clause (Bouncer Pattern / Early Exit) C. Factory Method D. Arrow Anti-Pattern
[95, 90, 88, 30]. In our project grading engine with a subject passing cutoff of 35, what will their status be?A. PROMOTED (Passed on aggregate) B. DEBARRED C. COMPARTMENT D. ESSENTIAL REPEAT
pct = 96.0?A. Gold B. Silver C. Bronze D. Gold and Silver
failed_subjects.append(sub)) better than using a boolean flag (has_failed = True)?A. Lists consume less memory than boolean flags in Python B. A list allows determining the exact backlog count (differentiating 1 subject for Compartment vs 2+ for Repeat) as well as displaying subject names C. Boolean flags cannot be used in for-loops D. Lists run on multi-threaded CPU cores in Python
Extend the academic evaluation system to calculate Semester Grade Point Average (SGPA) for an engineering degree program at an Indian University (AKTU / Anna University / VTU).
Each course carries a specific number of credit units (e.g., Data Structures: 4 credits, Mathematics: 4 credits, Physics Lab: 2 credits).
O (10 GP)A+ (9 GP)A (8 GP)B+ (7 GP)B (6 GP)C (5 GP)F (0 GP - Fail)$$\text{SGPA} = \frac{\sum (\text{Course Credits} \times \text{Grade Points})}{\sum \text{Total Course Credits}}$$
F, Academic Standing is "BACKLOG"."FIRST CLASS WITH DISTINCTION"."FIRST CLASS"."SECOND CLASS".How data and code flow step-by-step
In the next lesson, we will continue your Python learning journey with While Loop (13: Loops).
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
| Previous Lesson | Next Lesson |
|---|---|
| Structural Pattern Matching: Match-Case Statement | While Loop |
Test your understanding of this lesson with 5 questions. Each question has one correct answer.