Week 1

Environment setup

How Java works

Types and Variables

Arrays

Basic IO

Control Flow

Packages

OOP in Java

Static Members

Practice

Assignment

Back end Track

Week 1 Assignment — Student Grade Manager

📋 Overview

You will build a command-line Student Grade Manager for a fictional school. The program allows a school administrator to register students, record their module grades, view reports, and look up individual students — all from the terminal.

This assignment is designed to take 2–3 days. Read the full brief before writing any code.


🎯 What You Will Practise


🏫 Domain — HYF Academy

You are building a grade management tool for HYF Academy. The academy runs a backend track with the following fixed modules:

1. Java Basics
2. Control Flow
3. OOP Fundamentals
4. Arrays & Collections
5. Input & Output

Each module is graded on a scale of 0–100. A student passes a module with a grade of 55 or above. A student passes the overall track if their average grade is 60 or above.


📦 Required Package Structure

Your project must follow this package structure:

com.hyfacademy
├── model
│   └── Student.java
├── service
│   └── GradeService.java
├── util
│   └── GradeUtils.java
└── Main.java

🔧 Specification

Studentcom.hyfacademy.model

A Student represents one enrolled student.

Fields (all private):

Static field:

Constructors:

Getters: for all fields Setter:

Methods:


GradeUtilscom.hyfacademy.util

A utility class (private constructor, all static methods) for grade calculations and formatting.

Constants (static final):

Methods:


GradeServicecom.hyfacademy.service

The service layer that manages the list of students and drives the application logic.

Fields (all private):

Static constant:

Methods:


Maincom.hyfacademy

The entry point. Creates a GradeService and calls run().

public class Main {
    public static void main(String[] args) {
        GradeService service = new GradeService();
        service.run();
    }
}

🖥️ Required Output Formats

Main Menu

╔══════════════════════════════════════╗
║         HYF ACADEMY — GRADE MGR      ║
╚══════════════════════════════════════╝
  1. Add student
  2. Enter grades
  3. View all students
  4. View student report
  5. Exit
══════════════════════════════════════
Choose an option:

View All Students Table

══════════════════════════════════════════════════════════════
  ID         NAME                 AVERAGE   GRADE   STATUS
══════════════════════════════════════════════════════════════
  HYF-001    Alice van der Berg    82.40      B      PASS
  HYF-002    Bob Jansen            53.20      F      FAIL
  HYF-003    Carol de Groot        91.00      A      PASS
══════════════════════════════════════════════════════════════
  Total students: 3   Passing: 2   Failing: 1
══════════════════════════════════════════════════════════════

Student Report

══════════════════════════════════════
  STUDENT REPORT
══════════════════════════════════════
  ID      : HYF-001
  Name    : Alice van der Berg
──────────────────────────────────────
  MODULE GRADES
──────────────────────────────────────
  Java Basics           :  88   PASS
  Control Flow          :  76   PASS
  OOP Fundamentals      :  91   PASS
  Arrays & Collections  :  70   PASS
  Input & Output        :  87   PASS
──────────────────────────────────────
  Average  :  82.40
  Grade    :  B
  Status   :  ✓ PASS
══════════════════════════════════════

📋 Requirements Checklist

Functionality

Code Structure