0% found this document useful (0 votes)
22 views

Comp 228 Lab 1 Absolute Final

Comp 228 Lab 1 Absolute Final

Uploaded by

aleguzman88ca
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)
22 views

Comp 228 Lab 1 Absolute Final

Comp 228 Lab 1 Absolute Final

Uploaded by

aleguzman88ca
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/ 3

Java Programming COMP-228

Centennial College

COMP 228: Java Programming


LAB #1 – Java Class

Student: ___Manuel Guzman 301318628_________________________________________

Due Date: Week 3

References: Learning materials for week 1, 2, textbook, and other references (if any)

Purpose: The purpose of this Lab assignment is to:


 Practice the use Java classes, Java methods, and other concepts taught.

This material provides the necessary information you need to complete the exercises.

Be sure to read the following general instructions carefully:


This lab should be completed individually by all the students.

YOU NEED TO SUBMIT THE FOLLOWING 2 DOCUMENTS IN THE DROPBOX


TITLED LAB1:
1. THE FIRST ONE IS A WORD DOCUMENT. USE THIS DOCUMENT AS YOUR
FIRST DELIVERABLE. DO NOT DELETE THE INSTRUCTIONS OR
QUESTIONS. AT THE END OF THIS DOCUMENT SIMPLY ADD SCREEN
SHOTS OF THE RUNNING STATE OF EACH EXERCISE (If there are more than
1 exercise). THE SCREEN SHOTS SHOULD COVER ALL THE
ASPECTS/FUNCTIONALITIES OF EACH EXERCISE (If there are more than 1
exercise).. AFTER THE SCREEN SHOTS PLEASE COPY THE CODE FROM
THE CODE WINDOW AND PASTE THE COMPLETE CODE. DO NOT GIVE
ME THE SCREEN SHOTS OF THE CODE. DO NOT ZIP THIS FILE AND KEEP
IT SEPARATE FROM YOUR ZIPPED PROGAM FOLDER.
2. SUBMIT ALSO ONE ZIPPED PROJECT FOLDER/FILE THAT CONTAINS ALL
THE EXERISES (If there are more than 1 exercise) SEPARATELY INTO THE
SAME DROP BOX.

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 a class named Singers with the following specifications:


 5 instance variables that would store the following singer data (Use recommended
variable naming conventions and appropriate data type for each instance
variable):
o Singer’s id
o Singer’s name
o Singer’s address
o Date of birth
o Number of albums published
 Two constructors that would allow you to construct Singer object with no
arguments and 5 arguments.

 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

You might also like