By the end of this chapter, you will be able to:
Mastering these skills will help you write clean, efficient programs that solve real-world problems just like professional developers do!
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Functional computer installed with Java IDE (NetBeans/Eclipse/IntelliJ) | Class attributes: bookID, title, author, isAvailable |
| Plain paper | Methods: displayDetails(), borrowBook(), returnBook() |
| Pen |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Functional computer installed with Java IDE (NetBeans/Eclipse/IntelliJ) | 1 Pc per Candidate |
| 2 | Plain paper | 1 Pc per Candidate |
| 3 | Pen | 1 Pc per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Define Class and Attributes | |||
| Launched the Java IDE (Award 2 marks or 0) | 2 | ||
| Declared class named 'Book' (Award 2 marks or 0) | 2 | ||
| Declared attributes: bookID, title, author, isAvailable (Award 1 mark for each attribute declared correctly) | 4 | ||
| Sub-Total | 8 | ||
| TASK 2: Implement Methods | |||
| Declared method displayDetails() that prints all book attributes (Award 3 marks or 0) | 3 | ||
| Declared method borrowBook() that sets isAvailable to false (Award 3 marks or 0) | 3 | ||
| Declared method returnBook() that sets isAvailable to true (Award 3 marks or 0) | 3 | ||
| Sub-Total | 9 | ||
| TASK 3: Create and Manipulate Objects | |||
| Created at least two Book objects with initial values (Award 3 marks or 0) | 3 | ||
| Called displayDetails() method on each object (Award 3 marks or 0) | 3 | ||
| Called borrowBook() on one object and verified isAvailable status (Award 3 marks or 0) | 3 | ||
| Called returnBook() on same object and verified isAvailable status (Award 3 marks or 0) | 3 | ||
| Sub-Total | 12 | ||
| PRODUCT CHECKLIST | |||
| Class Book correctly defined with all attributes and methods (Award 6 marks or 0) | 6 | ||
| Objects created and methods function as expected with correct output (Award 5 marks or 0) | 5 | ||
| Sub-Total | 11 | ||
| GRAND TOTAL | 40 | ||
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Computer with Java IDE (Eclipse/NetBeans/IntelliJ) | Plain A4 Paper |
| Pen |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Computer with Java IDE (Eclipse/NetBeans/IntelliJ) | 1 Pc per Candidate |
| 2 | Plain A4 Paper | 2 Pcs per Candidate |
| 3 | Pen | 1 Pc per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Class Declaration and Attributes | |||
| Launched Java IDE and created a new Java project (Award 2 marks or zero) | 2 | ||
| Declared class named 'Student' (Award 2 marks or zero) | 2 | ||
| Declared private attributes: name (String), age (int), grade (char) (Award 2 marks for each correctly declared attribute) | 6 | ||
| Sub-Total | 10 | ||
| TASK 2: Getter and Setter Methods Implementation | |||
| Declared public getter methods for all private attributes (Award 2 marks for each correctly implemented getter method) | 6 | ||
| Declared public setter methods for all private attributes (Award 2 marks for each correctly implemented setter method) | 6 | ||
| Setter methods include basic validation: age >= 0, grade is a valid char (Award full 4 marks if validation is implemented correctly, else zero) | 4 | ||
| Sub-Total | 16 | ||
| TASK 3: Testing and Display | |||
| Created a main method to instantiate the Student class object (Award 2 marks or zero) | 2 | ||
| Used setter methods to assign values to attributes (Award 1 mark for each attribute assigned correctly) | 3 | ||
| Used getter methods to display the attribute values (Award 1 mark for each attribute displayed correctly) | 3 | ||
| Sub-Total | 8 | ||
| PRODUCT CHECKLIST | |||
| Class 'Student' compiles without errors and encapsulation is correctly implemented (Award 5 marks if code compiles and encapsulation is demonstrated) | 5 | ||
| Getter and setter methods correctly restrict direct access to private attributes (Award 5 marks for proper use of access modifiers and method functionality) | 5 | ||
| Output shows correct attribute values retrieved via getter methods (Award 5 marks if output matches assigned values) | 5 | ||
| Sub-Total | 15 | ||
| GRAND TOTAL | 49 | ||
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.