Homework 07

Cats and Dogs

Due 04/11/2025 by 11:55pm

 

Objective:

 

Write a program where a user populates a collection of various cats and dogs.  The user should be able to specify which type they wish to enter, and then are prompted with pertinent information for every type of pet. In addition, the solution must follow the design provided.

 

 

 

Requirements: 

 

Example Dialog:

*The following Example Dialog demonstrates the interactions between a user and ONE possible implementation of the required software’s front-end / user interface. The software’s front-end / user interface may be implemented in MANY different ways and will receive full credit as long as it meets the most minimal of the above requirements. While you may use the example dialog as a guide, it is strongly encouraged to create the front-end / user interface in your own way. *

Key

Unhighlighted Text

Program’s Output

Highlighted Text

User’s Input

 

Welcome to the Animal Collection!

Enter 1. To Add an Animal.

Enter 2. To Remove an Animal.

Enter 9. To Quit.

1

Enter the kind of Animal.

1. For Animal

2. For Cat

3. For Dog

4. For House Cat

5. For Leopard

6. For Domestic Dog

7. For Wolf

4

Enter the Animal's Name

Mr. Flufferkins

Enter the Animal's Weight

8.6

Enter the Cat's mood. "sleepy", "playful", "hungry"

playful

Enter the House Cat's Type. "short hair", "ragdoll", "sphinx", "scottish fold"

ragdoll

----------------------

Name : Mr. Flufferkins

Weight: 8.6

Mood: playful

Type: ragdoll

----------------------

Enter 1. To Add an Animal.

Enter 2. To Remove an Animal.

Enter 9. To Quit.

1

Enter the kind of Animal.

1. For Animal

2. For Cat

3. For Dog

4. For House Cat

5. For Leopard

6. For Domestic Dog

7. For Wolf

6

Enter the Animal's Name

Rufus

Enter the Animal's Weight

20

Enter the Dog's Energy Level. Between 1 and 100.

99

Enter the Domestic Dog's Type. "retriever", "terrier", "husky", "mutt"

mutt

----------------------

Name : Mr. Flufferkins

Weight: 8.6

Mood: playful

Type: ragdoll

----------------------

----------------------

Name : Rufus

Weight: 20.0

Energy Level: 99

Type: mutt

----------------------

Enter 1. To Add an Animal.

Enter 2. To Remove an Animal.

Enter 9. To Quit.

1

Enter the kind of Animal.

1. For Animal

2. For Cat

3. For Dog

4. For House Cat

5. For Leopard

6. For Domestic Dog

7. For Wolf

1

Enter the Animal's Name

asdf

Enter the Animal's Weight

-4

----------------------

Name : Mr. Flufferkins

Weight: 8.6

Mood: playful

Type: ragdoll

----------------------

----------------------

Name : Rufus

Weight: 20.0

Energy Level: 99

Type: mutt

----------------------

----------------------

Name : asdf

Weight: 0.0

----------------------

Enter 1. To Add an Animal.

Enter 2. To Remove an Animal.

Enter 9. To Quit.

2

Enter the kind of Animal.

1. For Animal

2. For Cat

3. For Dog

4. For House Cat

5. For Leopard

6. For Domestic Dog

7. For Wolf

1

Enter the Animal's Name

asdf

Enter the Animal's Weight

0

----------------------

Name : Mr. Flufferkins

Weight: 8.6

Mood: playful

Type: ragdoll

----------------------

----------------------

Name : Rufus

Weight: 20.0

Energy Level: 99

Type: mutt

----------------------

Enter 1. To Add an Animal.

Enter 2. To Remove an Animal.

Enter 9. To Quit.

1

Enter the kind of Animal.

1. For Animal

2. For Cat

3. For Dog

4. For House Cat

5. For Leopard

6. For Domestic Dog

7. For Wolf

5

Enter the Animal's Name

Fred

Enter the Animal's Weight

120

Enter the Cat's mood. "sleepy", "playful", "hungry"

hungry

Enter the Leopard's Spots. Greater than or equal to 1.

50

----------------------

Name : Mr. Flufferkins

Weight: 8.6

Mood: playful

Type: ragdoll

----------------------

----------------------

Name : Rufus

Weight: 20.0

Energy Level: 99

Type: mutt

----------------------

----------------------

Name : Fred

Weight: 120.0

Mood: hungry

Number of Spots: 50

----------------------

Enter 1. To Add an Animal.

Enter 2. To Remove an Animal.

Enter 9. To Quit.

9

----------------------

Name : Mr. Flufferkins

Weight: 8.6

Mood: playful

Type: ragdoll

----------------------

----------------------

Name : Rufus

Weight: 20.0

Energy Level: 99

Type: mutt

----------------------

----------------------

Name : Fred

Weight: 120.0

Mood: hungry

Number of Spots: 50

----------------------

Goodbye!

 

 

Finally: