-3

You are to write a program to track the vehicles that are parked in and out of a parking lot. When the program runs, the user should be able to the total and available parking spaces. The program should also display the menu:
[1] In
[2] Out
[3] View Parking Status
[4] Summary of Transactions
[5] Exit

Technical Implementation: Represent the parking spaces as a structure with 10 elements.
Functionalities
[1] In – display the available parking spaces, ask the user for the desired parking location. Check if the desired parking location is empty or not. If it is not empty, display the message “Parking space not available.” Otherwise, ask the user for the following values: plate number, time in (hh:mm). Display the message “Parked”.

[2] Out – display the occupied parking spaces, ask the user for the parking location that will be unoccupied. Check if the desired parking location is empty or not. If it is empty, display the message “Parking space is currently empty.” Otherwise, display the following values: plate number, time in (hh:mm). Ask the user for time out (hh:mm). The program should display the parking fee.
Parking fee is computed as: 100pesos for the first six hours, and 25pesos for every succeeding hour thereafter.

[3] View Parking Status

[4] Summary of Transactions
Display: total cars parked and total parking fee collected

WHAT SHOUL I DO PLS HELP

2
Contributors
1
Reply
5
Views
6 Years
Discussion Span
Last Post by ravenous
0

WHAT SHOULD I DO PLS HELP

Stop panicking and write some code!

The clues are all in the question, just read it calmly and plan what you need to do. It says "Represent the parking spaces as a structure with 10 elements", so your ParkingLot structure will have to contain an array with 10 elements, each with the details of a space:

struct ParkingLot{
    ParkingSpace spaces[10];
    double totalFees
};

A parking space might be another structure, perhaps similar to:

struct ParkingSpace{
    char occupied;
    time_t timeIn;
    char plateNumber[10];
    unsigned totalCarsParked;
};

Give it a go, don't panic and post some code!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.