-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkshop
145 lines (115 loc) · 2.99 KB
/
workshop
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package workfile;
public class Workshop {
public static void main(String[] args) {
float[][] lists = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}};
lists[0][0] = 1000;
lists[0][1] = 2000;
lists[0][2] = 12;
lists[0][3] = 100.51f;
lists[1][0] = 1000;
lists[1][1] = 2001;
lists[1][2] = 31;
lists[1][3] = 200f;
lists[2][0] = 1000;
lists[2][1] = 2002;
lists[2][2] = 22;
lists[2][3] = 150.86f;
lists[3][0] = 1000;
lists[3][1] = 2003;
lists[3][2] = 41;
lists[3][3] = 250f;
lists[4][0] = 1000;
lists[4][1] = 2004;
lists[4][2] = 55;
lists[4][3] = 244f;
lists[5][0] = 1001;
lists[5][1] = 2001;
lists[5][2] = 88;
lists[5][3] = 44.531f;
lists[6][0] = 1001;
lists[6][1] = 2002;
lists[6][2] = 121;
lists[6][3] = 88.11f;
lists[7][0] = 1001;
lists[7][1] = 2004;
lists[7][2] = 74;
lists[7][3] = 211f;
lists[8][0] = 1001;
lists[8][1] = 2002;
lists[8][2] = 14;
lists[8][3] = 88.11f;
lists[9][0] = 1002;
lists[9][1] = 2003;
lists[9][2] = 2;
lists[9][3] = 12.1f;
lists[10][0] = 1002;
lists[10][1] = 2004;
lists[10][2] = 3;
lists[10][3] = 22.3f;
lists[11][0] = 1002;
lists[11][1] = 2003;
lists[11][2] = 8;
lists[11][3] = 12.1f;
lists[12][0] = 1002;
lists[12][1] = 2002;
lists[12][2] = 16;
lists[12][3] = 94f;
lists[13][0] = 1002;
lists[13][1] = 2005;
lists[13][2] = 9;
lists[13][3] = 44.1f;
lists[14][0] = 1002;
lists[14][1] = 2006;
lists[14][2] = 19;
lists[14][3] = 90f;
float total1 = 0f;
float total2 = 0f;
float total3 = 0f;
byte average1 = 0;
byte average2 = 0;
byte average3 = 0;
for (int row = 0; row < lists.length; row++) {
if (lists[row][0] == 1000) {
total1 += lists[row][3];
average1 += 1;
}
else if(lists[row][0] == 1001) {
total2 += lists[row][3];
average2 += 1;
}
else if(lists[row][0] == 1002) {
total3 += lists[row][3];
average3 += 1;
}
}
System.out.println("1001 Kodlu Şipariş Toplam Fiyatı: " + total1);
System.out.println("1002 Kodlu Şipariş Toplam Fiyatı: " + total2);
System.out.println("1003 Kodlu Şipariş Toplam Fiyatı: " + total3);
System.out.println();
System.out.println("1001 Kodlu Şipariş Ortalama Fiyatı: " + total1/average1);
System.out.println("1002 Kodlu Şipariş Ortalama Fiyatı: " + total2/average2);
System.out.println("1003 Kodlu Şipariş Ortalama Fiyatı: " + total3/average3);
System.out.println();
for (int row = 0; row < lists.length; row++) {
System.out.println((int)lists[row][1] + " Kodlu Malın ortalama fiyatı: " + lists[row][3]/lists[row][2]);
}
for (int row = 0; row < lists.length; row++) {
System.out.println((int) lists[row][1]);
}
}
}