Name:
Surname:
Student Number:
Programming Exercises:
1. Is each of the following class identifiers (a) legal and conventional, (b) legal but
unconventional, or (c) illegal?
a. myClass
_______
b. void
_______
c. Golden Retriever
_______
d. invoice#
_______
e. 36542ZipCode
_______
f. Apartment
_______
g. Fruit
_______
h. 8888
_______
i. displayTotal()
_______
j. Accounts_Receivable
_______
2. Is each of the following method identifiers (a) legal and conventional, (b) legal but
unconventional, or (c) illegal?
a. associationRules()
_______
b. void()
_______
c. Golden Retriever()
_______
d. invoice#()
_______
e. 36542ZipCode()
_______
f. PayrollApp()
_______
g. getReady()
_______
h. 911()
_______
i. displayTotal()
_______
j. Accounts_Receivable()
_______
3. Name at least three attributes that might be appropriate for each of the following classes:
a. RealEstateListing
i. __________________________
ii. __________________________
iii. __________________________
b. Vacation
i. __________________________
ii. __________________________
iii. __________________________
c. CreditCardBill
i. __________________________
ii. __________________________
iii. __________________________
4. Name at least three real-life objects that are instances of each of the following classes:
a. Song
i. __________________________
ii. __________________________
iii. __________________________
b. CollegeCourse
i. __________________________
ii. __________________________
iii. __________________________
c. Musician
i. __________________________
ii. __________________________
iii. __________________________
5. Name at least three classes to which each of these objects might belong:
a. myRedBicycle
i. __________________________
ii. __________________________
iii. __________________________
b. friedEgg
i. __________________________
ii. __________________________
iii. __________________________
c. cellPhone
i. __________________________
ii. __________________________
iii. __________________________
6. Write, compile, and test a class that uses four println() statements to display four lines of
the lyrics of your favorite song.
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________