A constructor must be written that takes all the state values (fields) listed in the Dog class.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Dog objects must be created to store the information on each dog at the shelter.
The UML for the Dog object is given below
Dog
dogld: int
- name: string
- age: int
- breed: string
- sex: char
m for male, f for female
-foundHome: boolean
+ getld() :int
+ getName(): string
+ getAge():int
+ getBreed() :string
+ getSex():char
+ getHomeStatus(): boolean
+ setHomeStatus(status:boolean):void
+ getInfo() :string
A constructor must be written that takes all the state values (fields) listed in the Dog class.
Transcribed Image Text:Dog objects must be created to store the information on each dog at the shelter. The UML for the Dog object is given below Dog dogld: int - name: string - age: int - breed: string - sex: char m for male, f for female -foundHome: boolean + getld() :int + getName(): string + getAge():int + getBreed() :string + getSex():char + getHomeStatus(): boolean + setHomeStatus(status:boolean):void + getInfo() :string A constructor must be written that takes all the state values (fields) listed in the Dog class.
Menu Item
Description
Add Dog
1) Asks the user for all the state value information for a dog.
2) Checks if there is space in the array to hold the new dog.
3) Check that the dogld is not already used in the system.
4) Creates a new Dog object and adds it to the array if there is space. If the
array is full, print "Sorry... the Shelter is Full!".
Note: All new dogs have no home as yet (foundHome = false).
View all dogs
This menu option shows all dogs in the system. This includes dogs that have a
home and those that do not.
View all available dogs
Shows all dogs in the system, which have no homes as yet.
View a specific dog
1) Asks the user for a dogld.
2) Searches for a dog at the shelter with that dogld.
3) Displays the information of the dog associated with that dogld if found. If
the dog is not found, "There is no dog with that id.." must be displayed.
Update dog home status
1) Asks the user for a dogld.
2) Searches for a dog at the shelter with that dogld
3) If a dog with that id is found, the "foundHome" status is changed to true
and the dog information is to be displayed. If the dog is not found, the
message "There is no dog with that id.." should be displayed.
Exit
1) Prints a message "Thank you for using the Dog Shelter Management
System."
2) Exits the program
Transcribed Image Text:Menu Item Description Add Dog 1) Asks the user for all the state value information for a dog. 2) Checks if there is space in the array to hold the new dog. 3) Check that the dogld is not already used in the system. 4) Creates a new Dog object and adds it to the array if there is space. If the array is full, print "Sorry... the Shelter is Full!". Note: All new dogs have no home as yet (foundHome = false). View all dogs This menu option shows all dogs in the system. This includes dogs that have a home and those that do not. View all available dogs Shows all dogs in the system, which have no homes as yet. View a specific dog 1) Asks the user for a dogld. 2) Searches for a dog at the shelter with that dogld. 3) Displays the information of the dog associated with that dogld if found. If the dog is not found, "There is no dog with that id.." must be displayed. Update dog home status 1) Asks the user for a dogld. 2) Searches for a dog at the shelter with that dogld 3) If a dog with that id is found, the "foundHome" status is changed to true and the dog information is to be displayed. If the dog is not found, the message "There is no dog with that id.." should be displayed. Exit 1) Prints a message "Thank you for using the Dog Shelter Management System." 2) Exits the program
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY