Question: question 1 MachineHire Figure 1.0: DateDialog booking application suggested user interface. DateDialog is a booking application that allows large machines such as excavators, to be

question 1

MachineHire

question 1 MachineHire Figure 1.0: DateDialog booking application suggested user interface. DateDialog

Figure 1.0: DateDialog booking application suggested user interface.

DateDialog is a booking application that allows large machines such as excavators, to be booked. The main interface for the application is shown in Figure 1.0. Clicking on the New Hire Booking button shows a dialog. The dialog should have two datepicker controls to support the selection of start and end dates. The time interval between these two dates is calculated and multiplied by the cost per day as entered into a textfield by the user. On confirming the dialog, the booking information is shown in the labels on the main application interface (Figure 1.1).

Create an application main interface similar to that shown in Figure 1.0, complete with labels, text fields and button. Apply insets and spacing as required to control the component layout. Use a stylesheet to style the main application interface. Add an entry to the stylesheet for the root style and a further entry to highlight a button on cursor hover.

Design and create a dialog interface complete with datepickers, a text field for entry of the cost per day of hire, labels and buttons. Show the dialog when the New Hire Booking button is clicked.

On confirming the dialog, the dates selected by the user as well as the cost per day are retrieved from the dialog's controls.

Calculate the total cost of the booking based on the inclusive number of days booked as well as the figure from the Cost/Day text field. Finally, the finished booking information should be shown on the main application interface (Figure 1.1). For JavaFX development, Listing 1 shows the ChronoUnit call required to get the number of days between the dates selected.

is a booking application that allows large machines such as excavators, to

Figure 1.1: Finished booking information on the main application interface

//Top of file. Date imports.

import java.time.LocalDate;

import java.time.temporal.ChronoUnit;

//...other program code

//Within dialog code...

//Find the number of days between selected dates in datepickers.

long numOfDays = ChronoUnit.DAYS.between(

dpStartDate.getValue(), dpEndDate.getValue());

Listing 1: Finding the number of days between the dates selected in the datepickers (JavaFX only).

Machine Hire JOX Hire Start Date: Hire End Date: Total Hire Cost: New Hire Booking Machine Hire OOX Hire Start Date: 2017-06-05 Hire End Date: 2017-06-09 Total Hire Cost: Days booked: 5. Total cost: 500.0 New Hire Booking

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!