Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Parking Meter Part 1: Write a structure named ParkingMeter to model a parking me

ID: 3753884 • Letter: P

Question

Parking Meter

Part 1: Write a structure named ParkingMeter to model a parking meter.  Properties of the parking meter should include: location, meter number, start time, end time, maximum time, parking rate in dollars per minutes(e.g. 0.25 representing $.25/minute), and status (e.g. ticking, expired. May have more)

Start time and end time should be initialized to the current date (when instance is created).  See the following reference on Swift Date type.  The location, meter number, max time and parking rate should be initialized using memberwise initializers.  The status should be an enum type.  In addition, the structure should have the following instance methods: 


Mutating methods to update the address, meter number, max time, and parking rate.


a method to start the parking meter (what parameter(s) should method take? Imagine you starting a parking meter )


a method to check if meter has expired


a method to update the parking meter status


a method that returns the status of the meter and the time left


a method to extend time on the parking meter (by adding "change") 


These meters may be deployed in other countries. So you also need to add computed properties to represent the parking rate in other currencies (support at least one other currency).

Part 2: Create a macOS project (Command Line Tool) to test your structure. Your test program should have code to test all the properties and methods: create an instance ParkingMeter, start meter, check status & time left, extend time.

Deliverables: 1. Copies of your ParkingMeter structure and testing program (main.swift) in a text file

2. screenshots of your program's test runs showing your ParkingMeter structure behaves according to the above specifications.

Please can someone answer these questions.

Explanation / Answer

A modern parking meter, complete with computerized metering, blinking lights, ability to accept credit cards and some even come with a wireless payment method, cost from $600 to $1,200 each. Meters are a reoccurring cost since you must factor in the cost of replacing existing ones every 15 to 20 years. Then there are brand new areas to install meters in as cities expand a meter zone (they always expand meter zones). Figure around $150 to install each meter. So a typical meter costs around $750 each.

$1,980,000 = 2640 * $750.00

code: