JAVA PROGRAM • LEVEL 18 — PLACEMENT PROGRAMS & MINI PROJECTS
Build a Student Grade Report in Java
Learn build a student grade report in java with a complete, compiler-ready Java 17 example.
PROBLEM UNDERSTANDING
Input and expected output
No input required
Asha 90.00 A+
COMPLETE JAVA 17 PROGRAM
Complete Java 17 implementation
record Student(String name,int[] marks){double average(){return java.util.Arrays.stream(marks).average().orElse(0);}String grade(){double a=average();return a>=90?"A+":a>=75?"A":a>=60?"B":"C";}}class Main{public static void main(String[] args){Student s=new Student("Asha",new int[]{88,92,90});System.out.printf("%s %.2f %s%n",s.name(),s.average(),s.grade());}}CURRENT STEP
SELECTED LINE
EXPECTED OUTPUT FOR THE SAMPLE
Asha 90.00 A+
PROGRAM EXPLANATION
Algorithm and explanation
- Initialize the deterministic sample values used for build a student grade report in java.
- Create the required object and apply record and Stream average to its state or behavior.
- Print the final result and compare it with the documented sample output.
This Java 17 example demonstrates record, Stream average, and Classification through a complete, executable program. The values are intentionally small so students can trace each statement, verify the output, and then modify the example safely in the online compiler.
EFFICIENCY
Time and space complexity
O(n)
O(1)
DEBUGGING CHECKLIST
Common mistakes
Keep the class name Main and the entry method signature public static void main(String[] args) when using the online compiler.
Use record with compatible Java types; Java checks types and method signatures at compile time.
Java is case-sensitive, and every statement that requires a semicolon must end with one.
