Skip to content

CSU-CompSci-CS163-4/Lab05StrictHousehold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Lab05StrictHousehold

This lab will focus primarily on the use of constructors, setters, getters, and object instances.

For ease of access, here is the javadoc.

Step 1: Self-Explanation

Answer the following questions on a separate sheet of paper or in the comments of your code:

  1. What is a setter?
  2. What is a getter?
  3. Why do you think we have/use constructors?
  4. What do we call the object variables Household has of type Child, Guardian, and Dog?

Step 2: Implementation

For this assignment, you will see that Household and Guardian have been completed for you. You will need to complete the code in Child and Dog.

Step 3: Testing

After you have finished writing your code, run the tests in main and ad a few more of your own to test your work.

Step 4: Turning In

Once finished, be sure to submit your code to Zybooks and make sure to get your self-explanation checked.

Additional Information

This keyword

The "this keyword" is a very useful one. When you are working with a local variable and a class variable of the same name, you can use this.variablename to specify the class variable. Otherwise the local variable will be assumed.

You can think of it like this: say you work in an office and the big boss in charge is named Steve. You also have a coworker named Steve. When you mention Steve, everyone assumes you are refering to your coworker unless you specify Big Boss Steve, or this.Steve.

About

constructors, setters, getters, and object instances

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages