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 »
JavaFX


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 $5000 8% $5001 to 10,000 10% 10,001 and above 12% Computing Sales Amount from Commission as an input Commission Amount Commission rate $0 to $400 8% $401 to 900 10% More than $900 12% 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 AfterApr 06, 2021

Answer To: Microsoft Word - Simple_JavaFX_Assignment.docx JavaFX Assignment/Activity Develop a GUI program...

Pulkit answered on Apr 08 2021
142 Votes
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.geo
metry.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 {

@Override
public void start(Stage primaryStage) {
//creating a GridPane to arrange 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