Welcome to AssignmentCache!

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

Availability: In stock

$6.00

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

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

  • PRG421 Week 3 Lab 3.17 LAB Pet information (derived classes)
$6.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.

[profiler]
Memory usage: real: 18350080, emalloc: 17984184
Code ProfilerTimeCntEmallocRealMem