This repository was archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrakt2.java
More file actions
56 lines (45 loc) · 1.3 KB
/
Copy pathPrakt2.java
File metadata and controls
56 lines (45 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.example.pr2;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
public class HelloController {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private TextField TextY;
@FXML
public Button Button1;
@FXML
private TextField TextZ;
@FXML
private TextField TexxtX;
@FXML public void ButtonK()
{
int x,y,z;
try
{
x=Integer.parseInt(TexxtX.getText());
y=Integer.parseInt(TextY.getText());
z=Integer.parseInt(TextZ.getText());
int n=(x*x*y-(14*z));
double a= Math.sqrt(n);
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Результат");
alert.setHeaderText(null);
alert.setContentText(Double.toString(a));
alert.show();
}catch(Exception e)
{
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setTitle("Помилка!");
alert.setHeaderText(null);
alert.setContentText("Подивись краще!!!!");
alert.show();
}
}
}