0% found this document useful (0 votes)
17 views2 pages

Lab Test Question

Gracias

Uploaded by

Fayadh -12 AE 2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Lab Test Question

Gracias

Uploaded by

Fayadh -12 AE 2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab Test: Java Programming with Static Arrays and Static

Methods
Case Study: Student Grade Management System

Problem Statement

You are hired as a software developer for a small educational institution. The institution wants to
implement a Student Grade Management System to manage and analyze student grades for a
course. The name of the system is <Your Name>’s Grading Management System. The system
should be able to:

1. Add a new grade for a student.


2. Calculate the average grade of the class.
3. Find the highest and lowest grades in the class.
4. Display all the grades.

Task

Write a Java program to implement the Student Grade Management System using static arrays
and static methods only. Do not create any objects. Your program should include the following:

1. StudentGradeManager Class
o Fields: grades (a static array of integers to store grades), studentCount (a static
integer to keep track of the number of students)
o Methods:
 addGrade(int grade): Adds a new grade to the grades array.
 calculateAverage(): Calculates and returns the average grade.
 findHighestGrade(): Finds and returns the highest grade.
 findLowestGrade(): Finds and returns the lowest grade.
 displayGrades(): Displays all the grades.

Requirements

1. Initialize the grades array to hold up to 100 grades.


2. Create a menu-driven program that allows the user to choose from the following options:
o Add a new grade
o Calculate average grade
o Find the highest grade
o Find the lowest grade
o Display all grades
o Exit

Example Output
markdown
Copy code
Yosh’s Student Grade Management System
1. Add a new grade
2. Calculate average grade
3. Find the highest grade
4. Find the lowest grade
5. Display all grades
6. Exit
Enter your choice: 1
Enter the grade: 85
Grade added successfully!

Yosh’s Student Grade Management System


1. Add a new grade
2. Calculate average grade
3. Find the highest grade
4. Find the lowest grade
5. Display all grades
6. Exit
Enter your choice: 2
Average grade: 85.0

Guideline Scheme

1. Static Fields (20 marks)


o Static array grades: 10 marks
o Static integer studentCount: 10 marks
2. Static Methods (60 marks)
o addGrade method: 15 marks
o calculateAverage method: 15 marks
o findHighestGrade method: 10 marks
o findLowestGrade method: 10 marks
o displayGrades method: 10 marks
3. Menu-driven Program (10 marks)
o Correct implementation of the menu: 5 marks
o Correct handling of user input and calling respective methods: 5 marks
4. Output (10 marks)
o Correctness and clarity of output: 10 marks

Answer

Convert to pdf file and upload to the e-learning.

You might also like