-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbegin34.java
More file actions
45 lines (27 loc) · 910 Bytes
/
begin34.java
File metadata and controls
45 lines (27 loc) · 910 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
35
36
37
38
39
40
41
42
43
44
45
package begin;
import java.util.Scanner;
import static java.lang.System.in;
public class begin34 {
public static void main(String[] args) {
float X;
float A;
float Y;
float B;
Scanner scanner=new Scanner(in);
System.out.print("X:");
X = scanner.nextFloat();
System.out.print("A:");
A = scanner.nextFloat();
System.out.print("Y:");
Y = scanner.nextFloat();
System.out.print("B:");
B = scanner.nextFloat();
float ChocolatePrice;
ChocolatePrice = A / X;
System.out.printf("Shokoladlarning 1 kg narxi:%.2f \n",ChocolatePrice);
float ToffeesPrice;
ToffeesPrice = B / Y;
System.out.printf("Konfet 1kg narxi:%.2f\n",ToffeesPrice);
System.out.printf("Shokolad kofedan %.2f barobar qimmatroq \n",ChocolatePrice / ToffeesPrice);
}
}