🎯 Learning Goals
- Use
if,else if, andelseto control program flow. - Compare values with relational operators (
>,<,>=,<=,==,!=). - Combine conditions with logical operators (
&&,||,!). - Understand the difference between
==and.equals()for strings. - Use
switchfor clean multi‑way decisions.
Extract my java code below and insert into Eclipse. Modify code to include the message below. Reads a numeric score and prints a letter grade with simple thresholds.
🟦 Example 1: Grade Decider
import java.util.Scanner;
public class GradeDecider {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter score (0-100): ");
int score = in.nextInt();
if (score >= 90) {
System.out.println("A");
} else if (score >= 80) {
System.out.println("B");
} else if (score >= 70) {
System.out.println("C");
} else if (score >= 60) {
System.out.println("D");
} else {
System.out.println("F");
}
in.close();
}
}
Files to save in your google drive under your class name
and to Submit to (Google Classroom)
- PX_GradeDecider_lastname.png — screenshot inside Eclipse
- PX_GradeDecider_lastname.java — Java source file
- PX_GradeDecider_lastname.txt — plain-text copy of your code
- PX_GradeDecider_lastname.mp4 — short demo video of the program running