
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
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

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 5 images

Knowledge Booster
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
- Class field corruption must be prevented.arrow_forwardQuestion 52 Python is not great at Information Hiding because it doesn't allow creating data attributes for an instance from outside class definition allows access to data from outside class definition it doesn't allows access to data from outside class definition it doesn't allow write to data from outside class definitionarrow_forwardProgramming Exercise 10-1arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education