BSVZamora - Lab - Exp - 6 (Declaring Classes)
BSVZamora - Lab - Exp - 6 (Declaring Classes)
CCS0023L
(Object Oriented Programming)
EXERCISE
6
Declaring classes
Section:
TX24
Professor:
I. PROGRAM OUTCOME/S (PO) ADRESSED BY THE LABORATORY EXERCISE
b. Analyze a complex problem and identify and define the computing requirements appropriate
to its solution.
g. Analyze the local and global impact of computing information technology on individuals,
organizations and society.
}
– where,
public - means that our class is accessible to other classes outside the package
class - this is the keyword used to create a class in Java
StudentRecord - a unique identifier that describes our class
V. EXPERIMENTAL PROCEDURE:
a. Provide the necessary accessor and mutator methods for all the
attributes.
b. Constructors
3. AddressBook. Create a class address book that can contain 100 entries of
AddressBookEntry objects (use the class you created in the first exercise). You
should provide the following methods for the address book.
a. Add entry
b. Delete entry
c. View all entries
d. Update an entry
1.
2.
3.
VI. QUESTION AND ANSWER:
Getters (accessors) are methods that return the value of an object's attribute, allowing you to read it
from outside the class.
Setters (mutators) are methods that update or assign a value to an attribute, enabling you to modify
it from outside the class.
Constructors are essential for initializing objects, ensuring attributes are set correctly and
allowing flexibility in how objects are created
Note: The following rubrics/metrics will be used to grade students’ output in the lab Exercise
2.