Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Microsoft Word - Simple_JavaFX_Assignment.docx JavaFX Assignment/Activity Develop a GUI program using JavaFX that will compute sales commissions and sales amounts. The following schemes are used to...

1 answer below »
Microsoft Word - Simple_JavaFX_Assignment.docx
JavaFX Assignment/Activity

Develop a GUI program using JavaFX that will compute sales commissions and sales amounts.
The following schemes are used to determine the commission rate and sales amount.

Computing Commission
Sales Amount Commission rate
$0 to $ XXXXXXXXXX%
$5001 to 10, XXXXXXXXXX%
10,001 and above 12%

Computing Sales Amount from Commission as an input
Commission Amount Commission rate
$0 to $ XXXXXXXXXX%
$401 to XXXXXXXXXX%
More than $ XXXXXXXXXX%


The GUI design is given below:



General instructions for assignment submission are already sent via Slate email.

Please follow the following on runtime:

• When you run first time, your window will appear as shown below:


• After entering sales amount 15000 in the textfield and clicking “Compute sales Commission”, output
appears in a dialog box as shown below:

If you wish, you can display the output in the dos box or output box of the IDE

• If you enter commission amount 1500 in the textfield and you click “Compute Sales Amount”, your
output will appear in a message box as shown below:

If you wish, you can display the output in the dos box or output box of the IDE

• If you enter a character not a real number, then the following message box will appear upon click of
any of the two buttons (input is validated here):
Answered 1 days After Apr 06, 2021

Solution

Pulkit answered on Apr 08 2021
159 Votes
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class SalesConversion extends Application {

@Ove
ide
public void start(Stage primaryStage) {

creating a GridPane to a
ange elements
GridPane root = new GridPane();

adjusting padding and spacing
root.setHgap(10);
root.setVgap(10);
root.setPadding(new Insets(10));


creating label and text field
Label label = new Label("Please enter amount: ");
TextField input = new TextField();


creating buttons
Button computeCommision = new Button("Compute Sales Commision");
Button computeSales = new Button("Compute Sales Amount");
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here