Car Reservation

Create an application that allows a user to reserve a car for the specified day. A small car-reservation company can rent out only four cars per day. Let the application allow the user to specify a certain day. If four cars have already been reserved for that day, then indicate to the user that no vehicles are available.
What needs to be done
(1) Add a monthCalendar control to the form – drag and drop a monthCalendar control on the form. Set its names property to dateMonthCalendar.
(2) Importing System.IO namespace – Import namespace System. IO to allow file processing.
(3) Determining the number of reservations – create a method named NumberOfReservations that takes one argument of type Date. The procedure should use a LINQ that searches the reservations.txt file for reservations made for the selected date. The procedure should return the number of cars rented for the day selected. (HINT) Use the query result’s Count method to determine the number of elements in the result.
(4) Defining a sub procedure – create a sub procedure named checkReservations. This procedure should invoke the NumberOfReservations method, passing in the user selected day as an argument. the CheckReservations method should then retrieve the number returned by NumberOfReservations and determine whether four cars have been rented for that day . if four cars have been rented, then display a message dialog to the user stating that no cars are available that day for rental. If fewer than four cars have been rented for that day, create a StreamWriter object, passing reservations.txt as the first argument and True as the second argument to specify that data should be appended to any existing data. Write the day and the user’s name to the reservations.txt file and display a message dialog to the user stating that a car has been reserved.
(5) Define the reserveButton_Click event handler. Double click the Reserve Car Button to create the reserveButton_Click ecent handler. In the event handler, invoke the CheckReservations procedure and clear the Name: TextBox.

New Download