procedure
TForm1
.
btnCalculateClick(Sender: TObject);
var
I, J :
Integer
;
begin
I :=
46875
* StrToInt(Edit1
.
Text) +
9375
* StrToInt(Edit2
.
Text) +
1875
* StrToInt(Edit3
.
Text) +
375
* StrToInt(Edit4
.
Text) +
75
* StrToInt(Edit5
.
Text) +
15
* StrToInt(Edit6
.
Text) +
5
* StrToInt(Edit7
.
Text) + StrToInt(Edit8
.
Text);
lblCost
.
Caption := Format(
'%d$'
, [i]);
J :=
46875
*
5
* StrToInt(Edit1
.
Text) +
9375
*
5
* StrToInt(Edit2
.
Text) +
1875
*
5
* StrToInt(Edit3
.
Text) +
375
*
5
* StrToInt(Edit4
.
Text) +
75
*
5
* StrToInt(Edit5
.
Text) +
15
*
5
* StrToInt(Edit6
.
Text) +
5
*
5
* StrToInt(Edit7
.
Text) +
5
* StrToInt(Edit8
.
Text);
lblRating
.
Caption := Format(
'%d!'
, [J]);
I := Trunc(
46875
*
2.5
* StrToFloat(Edit1
.
Text) +
9375
*
2.5
* StrToFloat(Edit2
.
Text) +
1875
*
2.5
* StrToFloat(Edit3
.
Text) +
375
*
2.5
* StrToFloat(Edit4
.
Text) +
75
*
2.5
* StrToFloat(Edit5
.
Text) +
15
*
2.5
* StrToFloat(Edit6
.
Text) +
5
*
2.5
* StrToFloat(Edit7
.
Text) + StrToInt(Edit8
.
Text));
lblPrison
.
Caption := Format(
'%d часов %d минут'
, [I
div
60
, I
mod
60
]);
lblGetStar
.
Caption := Format(
'%.n звезд'
, [StrToFloat(edtVoice
.
Text) /
5
]);
btnAddText
.
Click;
I :=
46875
* StrToInt(Edit1
.
Text) +
9375
* StrToInt(Edit2
.
Text) +
1875
* StrToInt(Edit3
.
Text) +
375
* StrToInt(Edit4
.
Text) +
75
* StrToInt(Edit5
.
Text) +
15
* StrToInt(Edit6
.
Text) +
5
* StrToInt(Edit7
.
Text) + StrToInt(Edit8
.
Text);
lblStar
.
Caption := Format(
'%d звезд'
, [i]);
case
J
of
0..5
: lblPrestige
.
Caption :=
'Новичок'
;
6..10
: lblPrestige
.
Caption :=
'Бывалый(ая)'
;
11..15
: lblPrestige
.
Caption :=
'Уважаемый(ая)'
;
16..20
: lblPrestige
.
Caption :=
'Мастер'
;
21..25
: lblPrestige
.
Caption :=
'Профессионал(ка)'
;
26..50
: lblPrestige
.
Caption :=
'Гуру'
;
51..100
: lblPrestige
.
Caption :=
'Неприкасаемый(ая)'
;
101..500
: lblPrestige
.
Caption :=
'Папа/Мама'
;
501..1000
: lblPrestige
.
Caption :=
'Ангел'
;
1001..5000
: lblPrestige
.
Caption :=
'Бог/Богиня'
;
5001..10000
: lblPrestige
.
Caption :=
'Всемогущий(ая)'
;
10001..50000
: lblPrestige
.
Caption :=
'Mister/Miss'
;
50001..100000
: lblPrestige
.
Caption :=
'Легенда'
;
100001..500000
: lblPrestige
.
Caption :=
'Премьер'
;
else
lblPrestige
.
Caption :=
'Супер'
;
end
;
case
J
of
0..5
: Image9
.
Picture
.
LoadFromFile(
'image\1.png'
);
6..10
: Image9
.
Picture
.
LoadFromFile(
'image\2.png'
);
11..15
: Image9
.
Picture
.
LoadFromFile(
'image\3.png'
);
16..20
: Image9
.
Picture
.
LoadFromFile(
'image\4.png'
);
21..25
: Image9
.
Picture
.
LoadFromFile(
'image\5.png'
);
26..50
: Image9
.
Picture
.
LoadFromFile(
'image\6.png'
);
51..100
: Image9
.
Picture
.
LoadFromFile(
'image\7.png'
);
101..500
: Image9
.
Picture
.
LoadFromFile(
'image\8.png'
);
501..1000
: Image9
.
Picture
.
LoadFromFile(
'image\10.png'
);
1001..5000
: Image9
.
Picture
.
LoadFromFile(
'image\11.png'
);
5001..10000
: Image9
.
Picture
.
LoadFromFile(
'image\12.png'
);
10001..50000
: Image9
.
Picture
.
LoadFromFile(
'image\13.png'
);
50001..100000
: Image9
.
Picture
.
LoadFromFile(
'image\14.png'
);
100001..500000
: Image9
.
Picture
.
LoadFromFile(
'image\15.png'
);
else
Image9
.
Picture
.
LoadFromFile(
'image\16.png'
);
end
;
end
;