Question: This lab involves writing a program that will model two types of pets: cats and dogs. Pets have a name, a weight (in pounds), and

This lab involves writing a program that will model two types of pets: cats and dogs. Pets have a name, a weight (in pounds), and an age (in years). Pets can also make a sound...cats make a "meow" sound and dogs make a "bow wow" sound. The program should prompt the user to enter information for several different types of pets. It should create the appropriate class instances for each type of pet and store the objects in a single array. The program should then iterate through the array and display the pet attributes and the sound that each pet makes. The program should not check for the type of object in the array.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!