Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Create one class check in pets

per.Java class file

must include

all attributes with appropriate data structures

at least one constructor method must initialize petType, petName, perAge, and daysStay attributes 

accessors and mutators for all attributes

not required to connect to other classes or run as program practice creating class from uml diagram

The image shows a UML class diagram that illustrates the relationships between a general `Pet` class and its subclasses `Dog` and `Cat`.

### Class: Pet
- **Attributes and Methods**:
  - `+ Pet()`: Constructor for the Pet class.
  - `+ getPetType()`: Method to get the pet's type.
  - `+ setPetType()`: Method to set the pet's type.
  - `+ getPetName()`: Method to get the pet's name.
  - `+ setPetName()`: Method to set the pet's name.
  - `+ getPetAge()`: Method to get the pet's age.
  - `+ setPetAge()`: Method to set the pet's age.
  - `+ getDogSpaces()`: Method to get the number of dog spaces.
  - `+ setDogSpaces()`: Method to set the number of dog spaces.
  - `+ getCatSpaces()`: Method to get the number of cat spaces.
  - `+ setCatSpaces()`: Method to set the number of cat spaces.
  - `+ getDaysStay()`: Method to get the number of days the pet will stay.
  - `+ setDaysStay()`: Method to set the number of days the pet will stay.
  - `+ getAmountDue()`: Method to get the amount due for the stay.
  - `+ setAmountDue()`: Method to set the amount due for the stay.

### Class: Dog
- **Attributes**:
  - `- dogSpaceNumber`: The space number for the dog.
  - `- dogWeight`: The weight of the dog.
  - `- grooming`: Indicates if grooming is required.

- **Methods**:
  - `+ Dog()`: Constructor for the Dog class.
  - `+ getGrooming()`: Method to get grooming status.
  - `+ setGrooming()`: Method to set grooming status.
  - `+ getDogWeight()`: Method to get the dog's weight.
  - `+ setDogWeight()`: Method to set the dog's weight.
  - `+ getDogSpaceNumber()`: Method to get the dog's space number.
  - `+ setDogSpaceNumber()`: Method to set the dog's space number.

### Class: Cat
- **Attributes**:
  - `- catSpaceNumber`: The space number for the cat.
expand button
Transcribed Image Text:The image shows a UML class diagram that illustrates the relationships between a general `Pet` class and its subclasses `Dog` and `Cat`. ### Class: Pet - **Attributes and Methods**: - `+ Pet()`: Constructor for the Pet class. - `+ getPetType()`: Method to get the pet's type. - `+ setPetType()`: Method to set the pet's type. - `+ getPetName()`: Method to get the pet's name. - `+ setPetName()`: Method to set the pet's name. - `+ getPetAge()`: Method to get the pet's age. - `+ setPetAge()`: Method to set the pet's age. - `+ getDogSpaces()`: Method to get the number of dog spaces. - `+ setDogSpaces()`: Method to set the number of dog spaces. - `+ getCatSpaces()`: Method to get the number of cat spaces. - `+ setCatSpaces()`: Method to set the number of cat spaces. - `+ getDaysStay()`: Method to get the number of days the pet will stay. - `+ setDaysStay()`: Method to set the number of days the pet will stay. - `+ getAmountDue()`: Method to get the amount due for the stay. - `+ setAmountDue()`: Method to set the amount due for the stay. ### Class: Dog - **Attributes**: - `- dogSpaceNumber`: The space number for the dog. - `- dogWeight`: The weight of the dog. - `- grooming`: Indicates if grooming is required. - **Methods**: - `+ Dog()`: Constructor for the Dog class. - `+ getGrooming()`: Method to get grooming status. - `+ setGrooming()`: Method to set grooming status. - `+ getDogWeight()`: Method to get the dog's weight. - `+ setDogWeight()`: Method to set the dog's weight. - `+ getDogSpaceNumber()`: Method to get the dog's space number. - `+ setDogSpaceNumber()`: Method to set the dog's space number. ### Class: Cat - **Attributes**: - `- catSpaceNumber`: The space number for the cat.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education