-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath1.java
More file actions
37 lines (27 loc) · 1 KB
/
Math1.java
File metadata and controls
37 lines (27 loc) · 1 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
package math;
import java.util.Scanner;
import static java.lang.Math.pow;
import static java.lang.Math.sqrt;
public class Math1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Podaj wartosć zmiennej a: ");
int a = scanner.nextInt();
System.out.println("Podaj wartosć zmiennej b: ");
int b = scanner.nextInt();
//scanner.close();
System.out.println(0.5*a*(a *sqrt(3)/2));
System.out.println( pow(a,b));
int grade1 = 5;
int grade2 = 5;
int grade3 = 4;
System.out.println((double) (grade1 + grade2 + grade3)/3);
System.out.println(a*b);
System.out.println("Podaj kwotę netto: ");
double salary_net = scanner.nextDouble();
scanner.close();
int vat_tax = 23;
System.out.println(salary_net * (1 + (double)vat_tax/100));
System.out.printf("%.2fzl brutto \n ",salary_net * (1 + (double)vat_tax/100) );
}
}