Write this code in C# language: Scenario: A dog shelter would like a simple system to keep track of all the dogs that pass through their facility. You are required to make a command line-based dog shelter management application. Your application must allow a user to add, edit, search and view Contacts. The program must have a menu consisting of the following six (6) options: Add dog View all dogs View all available dogs View specific dog Update dog home status Exit Brief descriptions of each option in the menu 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 dogId 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 dogId. 2) Searches for a dog at the shelter with that dogId. 3) Displays the information of the dog associated with that dogId 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 dogId. 2) Searches for a dog at the shelter with that dogId 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 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 - dogId: int - name: string - age: int - breed: string - sex: char m for male, f for female -foundHome: boolean + getId() :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. A list of behaviours the Dog class must have is given in the following table: Method Name Scope Behaviour getId() Public Returns the dogId of the dog getName() public Returns the name of the dog getAge() public Returns age of the dog getBreed() public Returns the breed of the dog getSex() public Returns the sex of the dog getHomeStatus() public Returns the “foundHome” status of the dog setHomeStatus(status: boolean) Public Set the “foundHome” status of the dog to the status parameter. toInfo() public Returns a string containing all the information about the dog. This assignment specifically tests the concepts of arrays and Objects Oriented Design basics. Restrictions for this assignment: You must create and manage all arrays with your own code. You may NOT use other C# collection objects (for example arraylist or list etc) Please do NOT change the specifications. For example, do not add new contact data. You must create and manage all arrays with your own code. OOP design hint: Your main program should NOT directly be responsible for maintaining or managing the array of Dogs. You must create another object to manage the Dogs for you. Please write the code in C# language

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write this code in C# language:

 

 

Scenario:

A dog shelter would like a simple system to keep track of all the dogs that pass through their facility. You are required to make a command line-based dog shelter management application. Your application must allow a user to add, edit, search and view Contacts.

 

The program must have a menu consisting of the following six (6) options:

  • Add dog
  • View all dogs
  • View all available dogs
  • View specific dog
  • Update dog home status
  • Exit

Brief descriptions of each option in the menu

 

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 dogId 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 dogId.

2) Searches for a dog at the shelter with that dogId.

3) Displays the information of the dog associated with that dogId 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 dogId.

2) Searches for a dog at the shelter with that dogId

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

 

 

 

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

- dogId: int

- name: string

- age: int

- breed: string

- sex: char           m for male, f for female

-foundHome: boolean

+ getId() :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.

 

 

A list of behaviours the Dog class must have is given in the following table:

Method Name

Scope

Behaviour

getId()

Public

Returns the dogId of the dog

getName()

public

Returns the name of the dog

getAge()

public

Returns age of the dog

getBreed()

public

Returns the breed of the dog

getSex()

public

Returns the sex of the dog

getHomeStatus()

public

Returns the “foundHome” status of the dog

setHomeStatus(status: boolean)

Public

Set the “foundHome” status of the dog to the status parameter.

toInfo()

public

Returns a string containing all the information about the dog.

 

 

This assignment specifically tests the concepts of arrays and Objects Oriented Design basics.

 

Restrictions for this assignment:

You must create and manage all arrays with your own code.

  1. You may NOT use other C# collection objects (for example arraylist or list<type> etc)
  2. Please do NOT change the specifications. For example, do not add new contact data.
  3. You must create and manage all arrays with your own code.

 

 

 

OOP design hint:

Your main program should NOT directly be responsible for maintaining or managing the array of Dogs. You must create another object to manage the Dogs for you.

 

 

Please write the code in C# language

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education