Comp 228 Lab 1 Absolute Final
Comp 228 Lab 1 Absolute Final
Centennial College
References: Learning materials for week 1, 2, textbook, and other references (if any)
This material provides the necessary information you need to complete the exercises.
You must name your Eclipse/IntelliJ project according to the following rule:
YourFullName_COMP228Labnumber
Example: JohSmith_COMP228Lab1
Each exercise should be placed in a separate package named exercise1, exercise2, etc.
Submit your assignment in a zip file that is named according to the following rule:
YourLastName_COMP228Labnumber.zip
Example: JohSmith_COMP228Lab1.zip
Lab #2 Page 1 of 3
Java Programming COMP-228
Apply the naming conventions for variables, methods, classes, and packages:
- variable names start with a lowercase character
- classes start with an uppercase character
- packages use only lowercase characters
- methods start with a lowercase character
Exercise 1:
Write a Java application that creates a Java console application to keep records of singers and
displays stored record. Follow the following instructions to develop the application:
Create Setters and getters for all the instance variables of class Singer. Make sure
to have several setters that would allow you to set the values of individual
instance variables of the singer object. Also create one setter that would allow you
to set all the values of the instance variables at once. Create several getters that
would allow you to get the current individual values of each instance variables of
the Singer object.
Create the driver class that would create 1 Singer (singer1) object with the help of
the no argument constructor. Display the default values of the instance variables
of this object singer1.
Set the values of each instance variables with the help of the setter that sets all the
values. Display the values.
Now change the value of each instance variable using setter for each instance
variable. Display current value of each after the changes are done. Use getters for
each to accomplish this.
Lab #2 Page 2 of 3
Java Programming COMP-228
Evaluation:
Functionality
Correct implementation of classes 45%
(instance variable declarations,
constructors, getter and setter methods,
etc.)
Correct implementation of driver 45%
classes (declaring and creating objects,
calling their methods, interacting with
user, displaying results)
Friendly input/output 10%
Total 100%
Lab #2 Page 3 of 3