***GRADE CHECKER***

🎓 Java Program: Displaying Messages Based on Module Grades

🔹 Introduction

Grading systems are a big part of academic life, and in the world of programming, replicating that system can teach us a lot about how computers make decisions. In this post, we’ll walk through the thought process behind a simple Java program that takes a module grade entered by the user and displays the appropriate feedback or message based on that grade.

This task might seem straightforward, but it involves core programming skills like input handling, conditional statements, and logical flow — all essential for building real-world applications.


🔹 What the Program Is Designed to Do

Here’s what the program does from start to finish:

  • Prompts the user to enter a module grade (for example: 85, 72, 60, etc.)

  • Evaluates the input and determines which grade range it falls into

  • Displays a message based on performance (e.g., “Distinction”, “Pass”, “Fail”)

  • Helps the user interpret their academic result

This program is useful in any educational platform or grading system simulation and helps students understand how their scores translate into academic categories.


🔹 Mapping the Logic: Grade Ranges and Messages

To decide which message to show, the program checks the number against defined grade thresholds. These can be customized, but here’s a common breakdown:

Grade (%) Range Message Displayed
                 70 – 100                                "Distinction – Excellent work!"
                  60 – 69           "Merit – Great job!"
                  50 – 59           "Pass – You made it!"
                  40 – 49             "Borderline – Consider improving."
                   0 – 39            "Fail – Don’t give up!"
             Invalid Input            "NOT A VALID EXAM GRADE " 

This logic is implemented using if-else conditions — structures that allow programs to behave differently depending on user input.


🔹 How It Works: User Interaction Breakdown

  1. The user is prompted to enter a number representing their module grade.

  2. The program checks whether the input falls within valid numerical ranges.

  3. Based on where the number fits, a specific message is printed to the console.

  4. If the input is out of bounds (negative numbers or over 100), a validation message is shown.

This encourages users to enter correct input and teaches error-handling in real-life applications.


🔹 Why This Type of Program Matters

Although this program may seem simple, it offers serious foundational value:

  • Teaches conditional logic

  • Reinforces input validation

  • Encourages clear communication to the user

  • Demonstrates how to turn real-world processes into code logic

Plus, this exact same structure can be used in:

  • Online grading tools

  • Automated feedback systems

  • Exam portals and learning management systems


🔹 Sample Scenarios

Let’s look at some input/output examples to see how the program behaves:

➤ Example 1:

  • Input: 85

  • Output: "Distinction – Excellent work!"

➤ Example 2:

  • Input: 63

  • Output: "Merit – Great job!"

➤ Example 3:

  • Input: 51

  • Output: "Pass – You made it!"

➤ Example 4:

  • Input: 22

  • Output: "Fail – Don’t give up!"

➤ Example 5:

  • Input: 109

  • Output: "Please enter a valid grade between 0 and 100."

Each message is tailored, immediate, and adds a human touch — key traits in any user-facing program.


import java.util.Scanner;

public class GradeChecher {
    public static void main(String[] args) {
        System.out.println("WELCOME TO GRADE CHECHKER");
        Scanner sc = new Scanner(System.in);
        // acceptinging the module title from user
        System.out.print("ENTER MODULE TITLE: ");"Distinction – Excellent work!"
                  6069             "Merit – Great job!"
                  5059             "Pass – You made it!"
                  4049             "Borderline – Consider improving."
                   039              "Fail – Don’t give up!"
             Invalid Input            "Please enter a valid grade between 0 and 100."
        String GradeName = sc.nextLine();
        // acceptinging the module grade from user
        System.out.print("ENTER MODULE GRADE: ");
        int fGrade = sc.nextInt();
        if (fGrade <= 100 && fGrade >= 70) {
            System.out.println("Score In " + GradeName + " is " + fGrade + ", which is equivalent to---- A" \n"Distinction – Excellent work!");
        } else if (fGrade <= 69 && fGrade >= 60) {
            System.out.println("Score In " + GradeName + " is " + fGrade + ", which is equivalent to---- B" \n"Merit – Great job!");
        } else if (fGrade <= 59 && fGrade >= 50) {
            System.out.println("Score In " + GradeName + " is " + fGrade + ", which is equivalent to---- C" \n"Pass – You made it!");
        } else if (fGrade <= 49 && fGrade >= 40) {
            System.out.println("Score In " + GradeName + " is " + fGrade + ", which is equivalent to---- D" \n"Borderline – Consider improving.");
        } else if (fGrade <= 39 && fGrade >= 0) {
            System.out.println("Score In " + GradeName + " is " + fGrade + ", which is equivalent to---- F" \n"Fail – Don’t give up!");
        } else {
            System.out.println("Not A Valid Exam Grade IN " + GradeName);
        }
        sc.close();
    }
}

/* Name: Umaru Justin Rogers
ID: I-24-62999
Information Technology */

Comments

Popular posts from this blog

**" MILESTONE OF COMPUTING & PROGRAMMING LANGUAGE" **"SOFTWARE DEVELOPMENT PARADIGMS"

***Grading System for IPAM, University of Sierra Leone***