Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 130 - 2615_KEC
P. 130

    PROJECT 2: Grade Allotment Challenge

                      Software Used: CodeSkulptor

                      Objective:

                      Develop a Python program (WAP) to determine a student’s grade based on their marks by using:
                          Comparison and logical operators              Variables            Formatted outputs

                      Use Codeskulptor3-https://py3.codeskulptor.org/

                      Step-by-Step Instructions: (Plan IPO)
                      1.  Input: User enters the marks scored (dynamic - varies with each user).
                      2.  Process: Assign a grade based on the marks using the following criteria:

                          A- 85  and above      B- 75 to 84      C- 65 to 74      D- 55 to 64      E- Below 55
                      3.  Output: Display the greatest number in a formatted message. Refer to the sample

                                                   You have attained Grade B with 81 score.

                                      Code:                                             Flow:

                                                                                   ENTER SCORE

                                                                                  ASSIGN GRADE

                                                                                  IS SCORE >= 85?
                                                                                            NO

                                                                                        IS SCORE >= 75?

                                                                                                  NO

                                                                                              IS SCORE >= 65?
                                                                   YES
                                                                                                          NO
                                                                              YES
                                                                                                       IS SCORE >= 55?
                                                                                          YES
                                                                                                      YES        NO

                                                                 GRADE A    GRADE B     GRADE C     GRADE D    GRADE E

                      Bonus Feature:

                          Validation: Add input validation to ensure the user enters numeric values only.
                          Custom Messages: Include messages for exceptional performance (e.g., “Excellent Work!”
                          for Grade A).
                          Looping Feature: Allow the program to calculate grades for multiple students without restarting.

                      128   Premium Edition-VII

| 125 126 127 128 129 130 131 132 133 134 135 |