PRG/421 Week 3 Java 3.17 LAB: Pet information (derived classes)

Availability: In stock

Regular Price: $6.00

Special Price: $3.00

OR

PRG421 Week 3 Lab 3.17 LAB Pet information (derived classes)

Double click on above image to view full picture

Zoom Out
Zoom In

More Views

Quick Overview

PRG/421 Week 3 Lab 3.17 LAB: Pet information (derived classes)


The base class Pet has private fields petName, and petAge. The derived class Dog extends the Pet class and includes a private field for dogBreed. Complete main() to:
- create a generic pet and print information using printInfo().
- create a Dog pet, use printInfo() to print information, and add a statement to print the dog's breed using the getBreed() method.


Ex. If the input is:
Dobby
2
Kreacher
3
German Schnauzer


The output is:
Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: German Schnauzer

Regular Price: $6.00

Special Price: $3.00

Details

PRG/421 Week 3 Lab 3.17 LAB: Pet information (derived classes)

The base class Pet has private fields petName, and petAge. The derived class Dog extends the Pet class and includes a private field for dogBreed. Complete main() to:
- create a generic pet and print information using printInfo().
- create a Dog pet, use printInfo() to print information, and add a statement to print the dog's breed using the getBreed() method.

Ex. If the input is:
Dobby
2
Kreacher
3
German Schnauzer

The output is:
Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: German Schnauzer

Additional Information

Special Price $3.00

Product Tags

Use spaces to separate tags. Use single quotes (') for phrases.