Coding Specifications:
- Be sure to use explicit data conversions everywhere.
- You must have Option Strict On as the first line of code in your code file.
- Declare local variables to store the data provided by the user in the DateTimePicker controls,.
- Use descriptive variable names (using camel casing).
- Write the code for each necessary event handler so the app behaves according to the app specifications.
- Do not include any unused event handlers.
- Use proper indentation.
- Do not use more than one blank line when spacing out your code for readability. Poorly formatted code will receive a marks penalty.
- You do not need to handle any potential error conditions that have not been discussed.
GUI Specifications:
- Try to make the app look like the images above as much as possible.
- You may estimate the locations of the controls you add, but you should ensure consistency and symmetry where possible.
- The app should contain the following controls:
- 4 DateTimePicker controls
- 10 Label controls comprised of
- 7 descriptive Labels
- 3 output Labels
- 3 GroupBox controls
- 1 Button control
- Be sure to name your DateTimePicker controls EXACTLY as follows:
- arrivalDayDTP
- arrivalTimeDTP
- departDayDTP
- departTimeDTP
When the app first loads (in the images below, the app was run on February 2, 2018 at 9:49am):
The dates and time that display in the DateTimePicker controls should match the current time.
Next the user specifies the Vehicle Arrival date (February 6) using the corresponding DateTimePicker control:
Followed by the Vehicle Arrival time (12:45pm):
Next the user specifies the date she/he plans to pick up the vehicle (February 20) using the corresponding DateTimePicker control:
Follow by the time of the pick up (1:30pm):
The user then clicks the Calculate Button:
Notice that although the user is actually staying for a duration of 14 days, 0 hours and 45 minutes the user will pay for the full hour, so the Stay Duration is specified as 14 days and 1 hour.
Also notice that the Time until arrival is displayed as 4 days and 2 hours. If the current time is 9:49am on February 2, the actual time until arrival is 4 days, 2 hours and 56 minutes. For the purpose of displaying the Time until arrival, the minutes are ignored.
If the user changes any of the DateTimePicker controls then all of the output Labels should be cleared. For example, when the user changes the Vehicle Pick Up date to February 22 (at the same time) the outputs are cleared as shown:
Finally, your app should handle the situation where the user specifies a Vehicle Pick Up date and time that is before the Vehicle Arrival time. If the user does that a MessageBox should appear alerting the user to the erroneous situation and then adjust the Vehicle Pick Up date and time.
For example, if the user changes the Vehicle Pick Up date to February 4 (which is before February 6):
And, then clicks the user clicks the Calculate Button, the following should appear:
Then, when the user clicks OK to close the MessageBox, the Vehicle Arrival date and time in the Vehicle Arrival DateTimePicker controls should change to display the same date and time as the Vehicle Pick Up DateTimePicker controls. In such erroneous situations, both sets of DateTimePicker controls should display whatever date and time is specified for Vehicle Pick Up.