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

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

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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Class
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
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