incepted / oop-inheritance-abstraction-lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

title type duration creator
Abstraction - Household
lab
1:00
name city
Josh Bartz
NYC

Abstraction - Household

Introduction

Note: This can be a pair programming activity or done independently.

In this lab, you will be designing an app that creates and maintains Households. All Households will be able to gain income and pay 20% of their income in taxes. All Households will also have a Pet. All Pets can be fed, groomed, and played with.

You can express the state or action of something by printing messages to the command line, such as "Household sells X to gain income" or "Play fetch".

Exercise

Requirements

  • Must create at least 1 Abstract Class
  • Must use at least 1 Interface
  • Must create at least 2 households, each with a different kind of Pet.
  • Must use polymorphism to have each household gain income, pay their taxes, and care for their pet (feed, play with, and groom) in one loop.

Bonus:

  • Add additional classes/subclasses

Starter code

In the starter code folder, you will find a Driver class with the main method. This class will be where you implement all of your households.

Deliverable

A simple Java program that has at least two households. Print statements can be used to show their behavior.

Additional Resources

About


Languages

Language:Java 100.0%