Improve the parking transaction class below

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

Improve the parking transaction class below (use the other classes just for reference )

The diagram is a class diagram illustrating the relationships and attributes of a Parking Management System. Below is a detailed transcription and explanation of each class and its components:

### Classes and Their Attributes:

1. **TransactionManager:**
   - **Attributes:**
     - `transactions`: List of `ParkingTransaction` objects.
     - `discountFactory`: An object of `DiscountStrategyFactory`.
     - `discountRate`: A Double value representing the discount rate.
   - **Methods:**
     - `park(Date, ParkingPermit, ParkingLot)`: Returns a `ParkingTransaction` object.

2. **ParkingLot:**
   - **Attributes:**
     - `id`: A String representing the ID of the parking lot.
     - `name`: A String representing the name of the parking lot.
     - `address`: An Address object for the parking lot's location.
     - `strategy`: A String indicating the strategy used (possibly for pricing or discounting).
   - **Methods:**
     - `getDiscountStrategy()`: Returns a `DiscountStrategy` object.
     - `getDailyRate()`: Returns a monetary value representing the daily rate.

3. **ParkingTransaction:**
   - **Attributes:**
     - `date`: A Date object recording the transaction date.
     - `permit`: A `ParkingPermit` associated with the transaction.
     - `parkingLot`: The `ParkingLot` where the transaction occurred.
     - `chargedAmount`: A Money object indicating the amount charged.
   - **Methods:**
     - `getChargedAmount()`: Returns the charged amount as a Money object.
     - `getPermit()`: Returns the `ParkingPermit`.

### Relationships:

- **TransactionManager** manages multiple **ParkingTransaction** entries, connecting all transactions.
- **ParkingTransaction** is associated with a specific **ParkingLot** and requires a **ParkingPermit**.

This class diagram is useful for understanding the data structures and interactions in a parking management system, focusing on transaction management, parking lot details, and processing transactions with applicable discounts.
Transcribed Image Text:The diagram is a class diagram illustrating the relationships and attributes of a Parking Management System. Below is a detailed transcription and explanation of each class and its components: ### Classes and Their Attributes: 1. **TransactionManager:** - **Attributes:** - `transactions`: List of `ParkingTransaction` objects. - `discountFactory`: An object of `DiscountStrategyFactory`. - `discountRate`: A Double value representing the discount rate. - **Methods:** - `park(Date, ParkingPermit, ParkingLot)`: Returns a `ParkingTransaction` object. 2. **ParkingLot:** - **Attributes:** - `id`: A String representing the ID of the parking lot. - `name`: A String representing the name of the parking lot. - `address`: An Address object for the parking lot's location. - `strategy`: A String indicating the strategy used (possibly for pricing or discounting). - **Methods:** - `getDiscountStrategy()`: Returns a `DiscountStrategy` object. - `getDailyRate()`: Returns a monetary value representing the daily rate. 3. **ParkingTransaction:** - **Attributes:** - `date`: A Date object recording the transaction date. - `permit`: A `ParkingPermit` associated with the transaction. - `parkingLot`: The `ParkingLot` where the transaction occurred. - `chargedAmount`: A Money object indicating the amount charged. - **Methods:** - `getChargedAmount()`: Returns the charged amount as a Money object. - `getPermit()`: Returns the `ParkingPermit`. ### Relationships: - **TransactionManager** manages multiple **ParkingTransaction** entries, connecting all transactions. - **ParkingTransaction** is associated with a specific **ParkingLot** and requires a **ParkingPermit**. This class diagram is useful for understanding the data structures and interactions in a parking management system, focusing on transaction management, parking lot details, and processing transactions with applicable discounts.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
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