program 3 - Program Assignment #3 COP 3330 Summer 2011...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Title: “Program Assignment 3: Programming with Inheritance” Points: 100 points Due Date: Friday July 1 st by 11:55pm (WebCourses time) Objectives: (1) Learning how to use inheritance to develop programs in Java. (2) To combine many of the facets of Java that we have covered so far this semester. Description: In this programming assignment, you will use a GUI-based application program. The GUI will use buttons to display/enter information about pets. The underlying code will make use of a hierarchy of pets which is shown below. While the output of the program will not be particularly earth-shattering, the inner workings of the program will make use of most of what you have learned about Java this semester. Details: In this assignment you will implement a GUI-based program that uses the following hierarchy of pets to display information about each pet recorded in the system. The top three classes in the hierarchy are all abstract classes. I have provided a mostly complete implementation of the PetDatabase class – it contains all of the GUI details that we haven’t gotten to yet and is complete except for you needing to add the various pets to the database (see input specifications below for adding pets). The UML diagram shown above is the abstract view of the entire hierarchy represented in this application. The details for each class are given in the class specific UML diagrams shown below. The PetDatabase class I have written for you leaving you to only complete the adding in of the pets (see more below in input specifications). 1 Program Assignment #3 – COP 3330 – Summer 2011 Pets HouseHoldPet BarnYardPet PetDatabase GregorianCalendar uses Dog Cat Bird Rabbit Horse Cow
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Pets class is the superclass for all pets. It is an abstract class. 2 Pets # name: string // the name of the pet # favoriteFood: string //the pet’s favorite food to eat # owner: string //the name of the pet’s owner # Pets() //default constructor # Pets(n: string, o: string, ff: string) //overloaded constructor – name/owner/favfood + howIMove (): string //abstract method indicating how the pet moves around + setName(n: string): void //sets the pet’s name to n + setFavoriteFood(ff: string); void //sets the pet’s favorite food to ff + setOwner(o: string): void //sets the pet’s owner to o + toString(): string //overrides toString() method in Object class – returns Pet info . + addPetName(): string //used when user inputs new pet from console + addPetOwner(): string //used when user inputs new pet from console + addPetFavFood(): string //used when user input new pet from console
Background image of page 2
The HouseHoldPet class is a subclass of Pets and the superclass for all house hold pets. It is an abstract class. The
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

program 3 - Program Assignment #3 COP 3330 Summer 2011...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online