Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help coding this in java: instructions: Cell Solutions, a cell phone provider, sells the following data plans: 8 gigabytes per month: $ 4
I need help coding this in java:
instructions:
Cell Solutions, a cell phone provider, sells the following data plans:
gigabytes per month: $ per month
gigabytes per month: $ per month
gigabytes per month: $ per month
The provider sells the following phones. A percent sales tax applies to the sale of a phone.
Model : $
Model : $
Model : $
Customers may also select the following options:
Phone Replacement Insurance: $ per month
WiFi Hotspot Capability: $ per month
Write an application that displays a menu system. The menu system should allow the user to select one data plan, one phone, and any of the options desired. As the user selects items from the menu, the application should show the prices of the items selected.
This is in Main. Java:import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.layout.HBox;
import javafx.geometry.Pos;
import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.control.Button;
import javafx.scene.control.RadioButton;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.ToggleGroup;
import javafx.collections.ObservableList;
Smartphone Packages
public class Main extends Application
public static void mainString args
Launch the application.
launchargs;
@Override
public void startStage primaryStage
Data plan radio buttons
RadioButton gigRadioButton new RadioButton Gigabytes per month";
RadioButton gigRadioButton new RadioButton Gigabytes per month";
RadioButton gigRadioButton new RadioButton Gigabytes per month";
gigRadioButton.setSelectedtrue;
ToggleGroup dataGroup new ToggleGroup;
gigRadioButton.setToggleGroupdataGroup;
gigRadioButton.setToggleGroupdataGroup;
gigRadioButton.setToggleGroupdataGroup;
Label dataPrompt new LabelSelect a Data Plan";
Label dataDescriptor new LabelData Plan Cost:";
Label dataCostLabel new Label$ per month";
HBox dataCostHBox new HBox dataDescriptor, dataCostLabel;
VBox dataVBox new VBox dataPrompt, gigRadioButton, gigRadioButton,
gigRadioButton, dataCostHBox;
Register event handlers for the data plan radio buttons
gigRadioButton.setOnActionevent
dataCostLabel.setText$ per month";
;
gigRadioButton.setOnActionevent
dataCostLabel.setText$ per month";
;
gigRadioButton.setOnActionevent
dataCostLabel.setText$ per month";
;
Phone radio buttons
Register event handlers for the phone radio buttons
Options
CheckBox insuranceCheckBox new CheckBoxPhone Replacement Insurance";
CheckBox hotspotCheckBox new CheckBoxWiFi Hotspot Capabilty";
Label optionsDescriptor new LabelOptions Cost:";
Label optionsCostLabel new Label$;
HBox optionsCostHBox new HBox optionsDescriptor, optionsCostLabel;
VBox optionsVBox new VBox insuranceCheckBox, hotspotCheckBox, optionsCostHBox;
Register event handlers for the check boxes
insuranceCheckBox.setOnActionevent
;
hotspotCheckBox.setOnActionevent
;
Put everything into a VBox
VBox mainVBox new VBox dataVBox, phoneVBox, optionsVBox;
mainVBox.setAlignmentPosCENTER;
mainVBox.setPaddingnew Insets;
Add the main VBox to a scene.
Scene scene new ScenemainVBox;
Set the scene to the stage aand display it
primaryStage.setScenescene;
primaryStage.show;
Please follow the outline step by step so that i can follow along and undersan whats going on
Include a sample output as well, please.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started