This is a console application with a user input (menu, formatted output, etc.) emulating the work of the parking.
-
Add / remove the car with parking.
-
Refill the balance of the machine.
-
Write off the funds for the parking space (every N-seconds will trigger the timer and write off each car parking costs).
-
Display transaction history for the last minute.
-
Derive the total parking revenue.
-
Display the number of available parking spaces.
-
Every minute, write down the Transactions.log transaction amount for the last minute with a date stamp.
-
Print Transactions.log (format output)
There should be only 1 parking in the program. When you initialize the parking, you must use the Settings class. Parking keeps a list of machines / transactions.
You can add a car to the parking lot or pick up from the parking lot. Every N-second parking charges money from the car. If the car does not have enough money to pay parking, then write off the penalty (the penalty coefficient * the parking price). Also, we can not pick up the car until we replenish the balance and repeat the operation.
When debiting funds, parking keeps transactions for the last minute. At any time, we can turn to the parking lot and find out the current balance (earned money). We can apply to the parking lot and find out the amount of money earned in the last minute. We can apply to the parking lot and find out the number of free / occupied places in the parking lot. The cost of parking depends on the type of car.
-
Property Timeout (every N-second writes off the funds for the parking space) - the default is 3 seconds
Dictionary - a dictionary for storing parking prices (for example: for trucks - 5, for cars - 3, for buses - 2, for motorcycles - 1)
Property ParkingSpace - parking capacity (total number of seats)
Property Fine is the penalty factor
-
List of machines
Transaction List
Property Balance (Earned Money)
-
Property identifier
Property balance
Property type of machine
-
Passenger
Truck
Bus
Motorcycle
-
Property Date / Time of the Transaction
Property Machine ID
Property Write-off
Implement a simple navigation menu for the program
Use the Singleton pattern
Provide exception handling
Keep the code clean