1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ahat [919]
3 years ago
11

In this assignment, you will write a user interface for your calculator using JavaFX. Your graphical user interface (GUI) should

look like the screenshot below (creativity is good, but you also need to be able to design to customer specifications). When the user closes the window, the program should end. For this assignment the GUI does not need to respond to any other user input. Note that we are developing this GUI completely separately from any class. This is a common design pattern that is often called ModelView-Controller, or MVC. The model is the data your program deals with, the view is the user interface, and the controller responds to input from the view by acting on the data in the model. Developing programs in this way allows you to create diffe

Engineering
1 answer:
Zolol [24]3 years ago
4 0

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import javafx.application.Application;

import javafx.stage.Stage;

import javafx.scene.Group;

import javafx.scene.Scene;

import javafx.scene.layout.VBox;

import javafx.scene.layout.HBox;

import javafx.scene.control.TextField;

import javafx.scene.control.Button;

public class Calculator extends Application {

public static void main(String[] args) {

// TODO Auto-generated method stub

launch(args);

}

"at"Override

public void start(Stage primaryStage) throws Exception {

// TODO Auto-generated method stub

Group root = new Group();

VBox mainBox = new VBox();

HBox inpBox = new HBox();

TextField txtInput = new TextField ();

txtInput.setEditable(false);

txtInput.setStyle("-fx-font: 20 mono-spaced;");

txtInput.setText("0.0");

txtInput.setMinHeight(20);

txtInput.setMinWidth(200);

inpBox.getChildren().add(txtInput);

Scene scene = new Scene(root, 200, 294);

mainBox.getChildren().add(inpBox);

HBox rowOne = new HBox();

Button btn7 = new Button("7");

btn7.setMinWidth(50);

btn7.setMinHeight(50);

Button btn8 = new Button("8");

btn8.setMinWidth(50);

btn8.setMinHeight(50);

Button btn9 = new Button("9");

btn9.setMinWidth(50);

btn9.setMinHeight(50);

Button btnDiv = new Button("/");

btnDiv.setMinWidth(50);

btnDiv.setMinHeight(50);

rowOne.getChildren().addAll(btn7,btn8,btn9,btnDiv);

mainBox.getChildren().add(rowOne);

HBox rowTwo = new HBox();

Button btn4 = new Button("4");

btn4.setMinWidth(50);

btn4.setMinHeight(50);

Button btn5 = new Button("5");

btn5.setMinWidth(50);

btn5.setMinHeight(50);

Button btn6 = new Button("6");

btn6.setMinWidth(50);

btn6.setMinHeight(50);

Button btnMul = new Button("*");

btnMul.setMinWidth(50);

btnMul.setMinHeight(50);

rowTwo.getChildren().addAll(btn4,btn5,btn6,btnMul);

mainBox.getChildren().add(rowTwo);

HBox rowThree = new HBox();

Button btn1 = new Button("1");

btn1.setMinWidth(50);

btn1.setMinHeight(50);

Button btn2 = new Button("2");

btn2.setMinWidth(50);

btn2.setMinHeight(50);

Button btn3 = new Button("3");

btn3.setMinWidth(50);

btn3.setMinHeight(50);

Button btnSub = new Button("-");

btnSub.setMinWidth(50);

btnSub.setMinHeight(50);

rowThree.getChildren().addAll(btn1,btn2,btn3,btnSub);

mainBox.getChildren().add(rowThree);

HBox rowFour = new HBox();

Button btnC = new Button("C");

btnC.setMinWidth(50);

btnC.setMinHeight(50);

Button btn0 = new Button("0");

btn0.setMinWidth(50);

btn0.setMinHeight(50);

Button btnDot = new Button(".");

btnDot.setMinWidth(50);

btnDot.setMinHeight(50);

Button btnAdd = new Button("+");

btnAdd.setMinWidth(50);

btnAdd.setMinHeight(50);

rowFour.getChildren().addAll(btnC,btn0,btnDot,btnAdd);

mainBox.getChildren().add(rowFour);

HBox rowFive = new HBox();

Button btnEq = new Button("=");

btnEq.setMinWidth(200);

btnEq.setMinHeight(50);

rowFive.getChildren().add(btnEq);

mainBox.getChildren().add(rowFive);

root.getChildren().add(mainBox);

primaryStage.setScene(scene);

primaryStage.setTitle("GUI Calculator");

primaryStage.show();

}

}

You might be interested in
Find the value of L
KonstantinChe [14]

Answer:

the value is 356732 Volt

6 0
2 years ago
A turbine operates at steady state, and experiences a heat loss. 1.1 kg/s of water flows through the system. The inlet is mainta
strojnjashka [21]

Answer:

\dot W_{out} = 399.47\,kW

Explanation:

The turbine is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m\cdot (h_{in}-h_{out}) = 0

The work done by the turbine is:

\dot W_{out} = \dot m \cdot (h_{in}-h_{out})-\dot Q_{out}

The properties of the water are obtained from property tables:

Inlet (Superheated Steam)

P = 10\,MPa

T = 520\,^{\textdegree}C

h = 3425.9\,\frac{kJ}{kg}

Outlet (Superheated Steam)

P = 1\,MPa

T = 280\,^{\textdegree}C

h = 3008.2\,\frac{kJ}{kg}

The work output is:

\dot W_{out} = \left(1.1\,\frac{kg}{s}\right)\cdot \left(3425.9\,\frac{kJ}{kg} -3008.2\,\frac{kJ}{kg}\right) - 60\,kW

\dot W_{out} = 399.47\,kW

5 0
3 years ago
A structural component in the shape of a flat plate 25.0 mm thick is to be fabricated from a metal alloy for which the yield str
balandron [24]

Answer:

The critical length of surface flaw = 6.176 mm

Explanation:

Given data-

Plane strain fracture toughness Kc = 29.6 MPa-m1/2

Yield Strength = 545 MPa

Design stress. =0.3 × yield strength

= 0.3 × 545

= 163.5 MPa

Dimensionless parameter. Y = 1.3

The critical length of surface flaw is given by

= 1/pi.(Plane strain fracture toughness /Dimensionless parameter× Design Stress)^2

Now putting values in above equation we get,

= 1/3.14( 29.6 / 1.3 × 163.5)^2

=6.176 × 10^-3 m

=6.176 mm

5 0
3 years ago
Read 2 more answers
what are the characteristics of an ideal fluid the general relation between shear stress and velocity gradient​
Dafna11 [192]

Answer:

ideal fluid follow Newtonian law

that is, shear stress is directly proportional to rate change of shear strain.

watch handwritten explanation

6 0
3 years ago
Steam enters a two-stage adiabatic turbine at 8 MPa and 5008C. It expands in the first stage to a state of 2 MPa and 3508C. Stea
Nataly [62]

Answer:

1) The exergy of destruction is approximately 456.93 kW

2) The reversible power output is approximately 5456.93 kW

Explanation:

1) The given parameters are;

P₁ = 8 MPa

T₁ = 500°C

From which we have;

s₁ = 6.727 kJ/(kg·K)

h₁ = 3399 kJ/kg

P₂ = 2 MPa

T₂ = 350°C

From which we have;

s₂ = 6.958 kJ/(kg·K)

h₂ = 3138 kJ/kg

P₃ = 2 MPa

T₃ = 500°C

From which we have;

s₃ = 7.434 kJ/(kg·K)

h₃ = 3468 kJ/kg

P₄ = 30 KPa

T₄ = 69.09 C (saturation temperature)

From which we have;

h₄ = h_{f4} + x₄×h_{fg} = 289.229 + 0.97*2335.32 = 2554.49 kJ/kg

s₄ =  s_{f4} + x₄×s_{fg} = 0.94394 + 0.97*6.8235 ≈ 7.563 kJ/(kg·K)

The exergy of destruction, \dot X_{dest}, is given as follows;

\dot X_{dest} = T₀ × \dot S_{gen} = T₀ × \dot m × (s₄ + s₂ - s₁ - s₃)

\dot X_{dest} = T₀ × \dot W×(s₄ + s₂ - s₁ - s₃)/(h₁ + h₃ - h₂ - h₄)

∴ \dot X_{dest} = 298.15 × 5000 × (7.563 + 6.958 - 6.727 - 7.434)/(3399 + 3468 - 3138  - 2554.49) ≈ 456.93 kW

The exergy of destruction ≈ 456.93 kW

2) The reversible power output, \dot W_{rev} = \dot W_{} + \dot X_{dest} ≈ 5000 + 456.93 kW = 5456.93 kW

The reversible power output ≈ 5456.93 kW.

6 0
3 years ago
Other questions:
  • function summedValue = SummationWithLoop(userNum) % Summation of all values from 1 to userNum summedValue = 0; i = 1; % Write a
    11·1 answer
  • A circular ceramic plate that can be modeled as a blackbody is being heated by an electrical heater. The plate is 30 cm in diame
    15·1 answer
  • Air modeled as an ideal gas enters a well-insulated diffuser operating at steady state at 270 K with a velocity of 180 m/s and e
    11·1 answer
  • Thermal energy storage systems commonly involve a packed bed of solid spheres, through which a hot gas flows if the system is be
    13·1 answer
  • A 10-mm steel drill rod was heat-treated and ground. The measured hardness was found to be 290 Brinell. Estimate the endurance s
    14·1 answer
  • ________ is the most theoretical computing discipline, focusing mostly on finding new and better ways for computers to work
    9·1 answer
  • Steam enters a nozzle at 400°C and 800 kPa with a velocity of 10 m/s and leaves at 375°C and 400 kPa while losing heat at a rate
    7·1 answer
  • All of the following are categories for clutch covers except
    11·1 answer
  • potential difference is the work done in moving a unit positive charge from one point to another in an electric field. State Tru
    12·1 answer
  • By using order of magnitude analysis, the continuity and Navier-Stokes equations can be simplified to the Prandtl boundary-layer
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!