-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHW_07_06.java
More file actions
34 lines (27 loc) · 818 Bytes
/
HW_07_06.java
File metadata and controls
34 lines (27 loc) · 818 Bytes
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
package HW_160523e;
import java.util.Scanner;
public class HW_07_06 {
// Создайте переменные (любое имя) и определите типы (наиболее подходящие) для следующих выражений:
//
//
//(float) Math.pow(Math.E, 5) + 1.5;
//
//(byte) Math.log(2) + (short) 14;
//
//1 + 1.5;
public static void main(String[] args) {
//1
double q = 1.5;
float result = (float) (Math.pow(Math.E,5) + q);
System.out.println(result);
//2
short w = 14;
byte result2 = (byte) ((byte) Math.log(2) + w);
System.out.println(result2);
//3
int r = 1;
double t = 1.5;
double result3 = r + t;
System.out.println(result3);
}
}