0% found this document useful (0 votes)
12 views5 pages

Lab Assessment 1 August 2024RUBICKS

The document outlines the coursework for Module PRG2201 Object-Oriented Programming, focusing on creating a Student class in Java. It details the specifications for the class, including attributes, constructors, methods, and a marking scheme for assessment. The coursework is due in Week 8 and is worth 20% of the total grade.

Uploaded by

Jabir Jabir
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)
12 views5 pages

Lab Assessment 1 August 2024RUBICKS

The document outlines the coursework for Module PRG2201 Object-Oriented Programming, focusing on creating a Student class in Java. It details the specifications for the class, including attributes, constructors, methods, and a marking scheme for assessment. The coursework is due in Week 8 and is worth 20% of the total grade.

Uploaded by

Jabir Jabir
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/ 5

Module’s Information:

Module PRG2201 Object-Oriented Programming

Session AUGUST 2024

Programme BCSI/BITI

Harprith Kaur

Email: Room: A3-F03


Lecturer
[email protected]

Tel: 06-798 2000 ext 2337

Coursework Type Lab Assessment 1

Percentage 20% out of 100%

Handout Date Week 8

Due Date Week 8

Student’s Declaration:

I declare that:
 I understand what is meant by plagiarism
 This assignment is all my own work and I have acknowledged any use of the
published or unpublished works of other people.
 I hold a copy of this assignment which I can produce if the original is lost or
damaged

[Name/ID] __JABIR ABDULLA JABIR /I24025574_____________________

[Signature] J.A.JABIR_____________ [Date] ______3/10/2024_______________

Learning Outcomes Assessed:

CLO2 Display the ability to build an object-oriented computer application using JAVA
programming language. (P4, PLO3)
Description of Coursework #1:

Part 1
Create a class named Student to represent a student's profile in a school system. The class should
meet the following specifications:
1. Attributes:
 name (String): the student's full name.
 id (int): the student's ID number.
 gpa (double): the student's grade point average (GPA).
 credits (int): the number of credits the student has earned.
2. Constructor:
 A parameterized constructor that initializes all the attributes (name, id, gpa,
credits).
3. Getters and Setters:
 Provide getter and setter methods for the attributes, but ensure that:
 The gpa cannot be negative or greater than 4.0.
 The credits cannot be negative.
4. Additional Methods:
addCredits(int credits): A method to add credits to the student's profile. Ensure the
credits are positive before adding them.
 isEligibleForGraduation(): A method that returns true if the student has at least
120 credits and a gpa of 2.0 or higher, otherwise returns false.
5. toString() Method:
 Override the toString() method to display the student’s details in the following
format:
Student Name: <name>, ID: <id>, GPA: <gpa>, Credits: <credits>

Part 2

Main Method:

 In the main method, create at least two Student objects with different values.
 Display the details of each student using the toString() method.
 Add credits to one of the students and check if they are eligible for graduation.
Sample Output

Student Name: Jimmy, ID: 1001, GPA: 3.6, Credits: 95


Student Name: Ali, ID: 1002, GPA: 2.8, Credits: 130
Updated Student: Student Name: Jimmy, ID: 1001, GPA: 3.6,
Credits: 115
Jimmy is not eligible for graduation.
Ali is eligible for graduation.
Marking Scheme

Criteria Marks Description Score


Class Definition 5 - Correctly defines
Attributes the class Student.
- Includes all
required attributes
(name, id, gpa,
credits) with
appropriate data
types.
Constructor 10 - Implements a
Implementation parameterized
constructor.
Getters and Setters 10 - Provides getter and
setter methods for
each attribute.
- Correctly validates 30 - Correctly
the gpa (between implements the
0.0 and 4.0). addCredits()
- Validates that method.
credits are non- - Correctly
negative. implements the
addCredits() Method isEligibleForGraduati
- Ensures that only on() method.
positive credits are
added.
isEligibleForGraduati
on() Method
- Checks that the
student has at least
120 credits and a
gpa of 2.0 or higher.
toString() Method 5 - Overrides the
toString() method.
Object Creation 5 - Correctly creates
(Main Method) two Student objects
in the main method
using the
parameterized
constructor.
- Properly assigns 5
unique values to
each object.
Method Usage and 10 - Successfully
Output demonstrates the
- Prints the correct use of addCredits()
updated details and and
graduation eligibility. isEligibleForGraduati
on() in the main
method.
Code Organization 5 - Code is well-
organized and
follows best
practices for
readability (e.g.,
proper indentation,
comments, and
logical structure).
Error-Free Execution 5 - The program
compiles and runs
without errors.
Code Efficiency 10 - The code follows
good practices for
efficiency (e.g.,
avoiding redundancy
in code, optimal
usage of methods,
and clean structure).
TOTAL 100

You might also like