-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinal_Soru2Cevap.cs
More file actions
59 lines (34 loc) · 1.27 KB
/
Final_Soru2Cevap.cs
File metadata and controls
59 lines (34 loc) · 1.27 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
57
58
59
int[] per = new int[4];
int[] tutar = new int[4];
int[] urun = new int[5];
int[] adet = new int[5];
int gelir = 0;
Random ras = new Random();
for (int i = 0; i < 4; i++)
{
per[i] = i + 1; tutar[i] = 0;
}
for(int i = 0; i<5;i++)
{
urun[i] = i + 1;
adet[i] = 0;
}
for(int i = 0;i<30;i++)
{
for (int k = 0; k < 4; k++)
{
for (int j = 0; j < 5; j++)
{
int sayi = ras.Next(1, 16);
tutar[k] = sayi * urun[j] * 3;
adet[j] += sayi;
gelir += tutar[k];
}
}
}
for (int i = 0; i < 5; i++)
{
if (i <= 3) Console.WriteLine("{0}. personelin satış tutarı = {1} \n",per[i],tutar[i]);
Console.WriteLine("{0}. üründen satılan toplam adet = {1}\n",urun[i],adet[i]);
}
Console.WriteLine("Toplam Gelir = {0}",gelir);