Автор работы: Пользователь скрыл имя, 08 Июня 2012 в 20:34, курсовая работа
В данной курсовой работе был разработан программный модуль, обеспечиваю¬щий эффективное начисление процентов депозитным вкладам.
Задание 3
Введение 4
1. Начисление процентов по вкладам 6
1.1. Депозитные вклады и их классификация 6
1.2. Формула расчета процентов по вкладам 8
2. Структура базы данных ”Депозитные вклады” 12
3. Руководство пользователя 13
3.1. Организация взаимодействия клиентской программы с БД 13
3.2. Разработка интерфейса пользователя 15
Заключение 23
Список литературы 24
Приложение 25
10. Заключение 23
11. Список литературы 24
end;
if periodicity = 'ежегодно' then
if countM mod 12<>0 then
begin
BalanceRef := (Summa*((Rate*(countM mod 12)*(365/12))/(36500)))-(Summa * ((RateRef * (countM mod 12)*(365/12)) / (36500)));
StringGrid.Cells[3,n]:=
BalanceRef:=round(BalanceRef*
if BalanceRef>0 then
StringGrid.Cells[4,n]:=
else
StringGrid.Cells[4,n]:='0';
if BalanceRef>0 then
BalanceRef := BalanceRef*35/100
else
BalanceRef :=0;
BalanceRef:=round(BalanceRef*
StringGrid.Cells[5,n]:=
StringGrid.Cells[6,n]:=
Summa := Summa+Summa*((Rate*(countM mod 12)*(365/12))/(36500))- BalanceRef;
end ;
if periodicity = 'в конце срока' then
begin
BalanceRef := (Summa*((Rate*(countM)*(365/
StringGrid.Cells[3,n]:=
BalanceRef:=round(BalanceRef*
if BalanceRef>0 then
StringGrid.Cells[4,n]:=
else
StringGrid.Cells[4,n]:='0';
if BalanceRef>0 then
BalanceRef := BalanceRef*35/100
else
BalanceRef :=0;
BalanceRef:=round(BalanceRef*
StringGrid.Cells[5,n]:=
StringGrid.Cells[6,n]:=
Summa := Summa+Summa * ((Rate * countM*(365/12)) / (36500))-BalanceRef;
end
end ;
Summa := round((Summa+Balance)*100)/
StringGrid.Cells[7,n] :=FloatToStr(Summa)+val;;
Balance:=0;
DecodeDate(time1, Year, Month, Day);
Month := Month+1;
If Month >12 then
begin
Year:= Year + Month div 12;
Month := Month mod 12;
end;
time1 := EncodeDate(Year, Month, Day);
timeBegin := DateTimeToStr(time1);
Delete(timeBegin , 11,10);
StringGrid.Cells[1,n]:=
end;
StringGrid.Cells[0,countM+1]:=
StringGrid.Cells[1,countM+1]:=
StringGrid.Cells[2,countM+1]:=
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGrid.Cells[3,n]:=
end;
sum:=round(sum*100)/100;
StringGrid.Cells[3,countM+1] := floatTostr(sum)+val;
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGrid.Cells[4,n]:=
end;
sum:=round(sum*100)/100;
StringGrid.Cells[4,countM+1] := floatTostr(sum)+val;
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGrid.Cells[5,n]:=
end;
sum:=round(sum*100)/100;
StringGrid.Cells[5,countM+1] := floatTostr(sum)+val;
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGrid.Cells[6,n]:=
end;
sum:=round(sum*100)/100;
StringGrid.Cells[6,countM+1] := floatTostr(sum)+val;
StringGrid.Cells[7,countM+1] :=StringGrid.Cells[7,countM];
end;
end;
procedure DepositCalc();
var
timeBegin,periodicity : string;
time1 : TDateTime;
countM:integer;
n:integer;
Balance,Summa,Rate,RateRef,
Year, Month, Day :Word;
begin
with MainForm do
begin
Val := ' руб.';
if ComboBox1.ItemIndex = 1
then Val := ' $';
if ComboBox1.ItemIndex = 2
then Val := ' €';
StringGridCalc.Cells[1,0]:=
StringGridCalc.Cells[0,0]:='Ва
StringGridCalc.Cells[1,1]:=
StringGridCalc.Cells[0,1]:=
StringGridCalc.Cells[1,2]:=
StringGridCalc.Cells[0,2]:=
StringGridCalc.Cells[1,3]:=
StringGridCalc.Cells[0,3]:='
StringGridCalc.Cells[1,4]:=
StringGridCalc.Cells[0,4]:=
StringGridCalc.Cells[1,5]:=
StringGridCalc.Cells[0,5]:=
StringGridCalc.Cells[1,6]:=
StringGridCalc.Cells[0,6]:=
StringGridCalc.Cells[1,7]:=
StringGridCalc.Cells[0,7]:='
StringGridCalc.Cells[1,8]:=
StringGridCalc.Cells[0,8]:='
Rate := FloatSpinEdit1.NumberValue;
RateRef := FloatSpinEdit2.NumberValue;
Summa :=SpinEdit1.Value;
countM:= SpinEdit2.Value;
time1:=DateTimePicker1.date;
periodicity := ComboBox2.Text;
StringGridDep.RowCount := countM+2;
StringGridDep.Cells[0,0]:='№';
StringGridDep.Cells[1,0]:='Дат
StringGridDep.Cells[2,0]:='Ост
StringGridDep.Cells[3,0]:='Нач
StringGridDep.Cells[4,0]:='Нал
StringGridDep.Cells[5,0]:='Сум
StringGridDep.Cells[6,0]:='Чис
StringGridDep.Cells[7,0]:='Сум
For n:=1 to countM do
begin
BalanceRef:=0;
StringGridDep.Cells[0,n]:=
StringGridDep.Cells[2,n]:=
if periodicity = 'ежемесячно' then
begin
Balance := (Summa * Rate * (365/12)) / (36500);
BalanceRef := (Summa * RateRef * (365/12)) / (36500);
end;
if periodicity = 'ежеквартально' then
if n mod 3=0 then
begin
Balance := (Summa * Rate * 3*(365/12)) / (36500);
BalanceRef := (Summa * RateRef * 3*(365/12)) / (36500);
end;
if periodicity = 'ежегодно' then
if n mod 12=0 then
begin
Balance := (Summa * Rate) / (100);
BalanceRef := (Summa * RateRef) / (100);
end ;
Balance:=round(Balance*100)/
BalanceRef:=round(BalanceRef*
BalanceRef :=Balance-BalanceRef;
BalanceRef:=round(BalanceRef*
If BalanceRef>0 then
begin
StringGridDep.Cells[4,n]:=
BalanceRef := BalanceRef*FloatSpinEdit3.
BalanceRef:=round(BalanceRef*
StringGridDep.Cells[5,n]:=
end
else
begin
StringGridDep.Cells[4,n]:='0';
StringGridDep.Cells[5,n]:='0';
end;
StringGridDep.Cells[3,n]:=
if BalanceRef>0 then
Balance:=Balance-BalanceRef;
Balance:=round(Balance*100)/
StringGridDep.Cells[6,n]:=
if n=countM then
begin
if periodicity = 'ежеквартально' then
if countM mod 3<>0 then
begin
BalanceRef := (Summa*((Rate*(countM mod 3)*(365/12))/(36500)))-(Summa * ((RateRef * (countM mod 3)*(365/12)) / (36500)));
StringGridDep.Cells[3,n]:=
BalanceRef:=round(BalanceRef*
if BalanceRef>0 then
StringGridDep.Cells[4,n]:=
else
StringGridDep.Cells[4,n]:='0';
if BalanceRef>0 then
BalanceRef := BalanceRef*FloatSpinEdit3.
else
BalanceRef :=0;
BalanceRef:=round(BalanceRef*
StringGridDep.Cells[5,n]:=
StringGridDep.Cells[6,n]:=
Summa := Summa+Summa*((Rate*(countM mod 3)*(365/12))/(36500))- BalanceRef;
end;
if periodicity = 'ежегодно' then
if countM mod 12<>0 then
begin
BalanceRef := (Summa*((Rate*(countM mod 12)*(365/12))/(36500)))-(Summa * ((RateRef * (countM mod 12)*(365/12)) / (36500)));
StringGridDep.Cells[3,n]:=
BalanceRef:=round(BalanceRef*
if BalanceRef>0 then
StringGridDep.Cells[4,n]:=
else
StringGridDep.Cells[4,n]:='0';
if BalanceRef>0 then
BalanceRef := BalanceRef*FloatSpinEdit3.
else
BalanceRef :=0;
BalanceRef:=round(BalanceRef*
StringGridDep.Cells[5,n]:=
StringGridDep.Cells[6,n]:=
Summa := Summa+Summa*((Rate*(countM mod 12)*(365/12))/(36500))- BalanceRef;
end ;
if periodicity = 'в конце срока' then
begin
BalanceRef := (Summa*((Rate*(countM)*(365/
StringGridDep.Cells[3,n]:=
BalanceRef:=round(BalanceRef*
if BalanceRef>0 then
StringGridDep.Cells[4,n]:=
else
StringGridDep.Cells[4,n]:='0';
if BalanceRef>0 then
BalanceRef := BalanceRef*FloatSpinEdit3.
else
BalanceRef :=0;
BalanceRef:=round(BalanceRef*
StringGridDep.Cells[5,n]:=
StringGridDep.Cells[6,n]:=
Summa := Summa+Summa * ((Rate * countM*(365/12)) / (36500))-BalanceRef;
end
end ;
Summa := round((Summa+Balance)*100)/
StringGridDep.Cells[7,n] :=FloatToStr(Summa)+val;
Balance:=0;
DecodeDate(time1, Year, Month, Day);
Month := Month+1;
If Month >12 then
begin
Year:= Year + Month div 12;
Month := Month mod 12;
end;
time1 := EncodeDate(Year, Month, Day);
timeBegin := DateTimeToStr(time1);
Delete(timeBegin , 11,10);
StringGridDep.Cells[1,n]:=
end;
StringGridDep.Cells[0,countM+
StringGridDep.Cells[1,countM+
StringGridDep.Cells[2,countM+
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGridDep.Cells[3,n]:=
end;
sum:=round(sum*100)/100;
StringGridDep.Cells[3,countM+
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGridDep.Cells[4,n]:=
end;
sum:=round(sum*100)/100;
StringGridDep.Cells[4,countM+
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGridDep.Cells[5,n]:=
end;
sum:=round(sum*100)/100;
StringGridDep.Cells[5,countM+
sum:=0;
for n:=1 to countM do
begin
sum:=sum+StrToFloat(
StringGridDep.Cells[6,n]:=
end;
sum:=round(sum*100)/100;
StringGridDep.Cells[6,countM+
StringGridDep.Cells[7,countM+
StringGridCalc.Cells[1,9]:= StringGridDep.Cells[3,countM+
StringGridCalc.Cells[0,9]:='На
StringGridCalc.Cells[1,10]:= StringGridDep.Cells[4,countM+
StringGridCalc.Cells[0,10]:='Н
StringGridCalc.Cells[1,11]:= StringGridDep.Cells[5,countM+
StringGridCalc.Cells[0,11]:='С
StringGridCalc.Cells[1,12]:= StringGridDep.Cells[6,countM+
StringGridCalc.Cells[0,12]:='Ч
StringGridCalc.Cells[1,13]:= StringGridDep.Cells[7,countM];
StringGridCalc.Cells[0,13]:='С
end;
end;
procedure TMainForm.ComboBox1Select(
begin
case ComboBox1.ItemIndex of
0: begin
label2.Caption := 'Сумма вклада (RUB):';
FloatSpinEdit2.NumberValue:=
end;
1: begin
label2.Caption := 'Сумма вклада (USD):';
FloatSpinEdit2.NumberValue:=9;
end;
2: begin
label2.Caption := 'Сумма вклада (EUR):';
FloatSpinEdit2.NumberValue:=9;
end
end;
DepositCalc();
end;
procedure TMainForm.
begin
DateTimePicker2.Date := IncMonth(DateTimePicker1.Date,
DepositCalc();
end;
procedure TMainForm.SpinEdit2Change(
begin
if SpinEdit2.Value>0 then
if DateTimePicker1.Date<
DateTimePicker2.Date := IncMonth(DateTimePicker1.Date,
DepositCalc();
end;
procedure TMainForm.
begin
if DateTimePicker1.Date<
then
SpinEdit2.Value :=MonthsBetween(
else
begin
SpinEdit2.Value:=1;
DateTimePicker2.Date:=
end;
DepositCalc();
end;
procedure TMainForm.GroupBox1MouseDown(
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if DateTimePicker1.Date<
then
SpinEdit2.Value :=MonthsBetween(
else
begin
SpinEdit2.Value:=1;
DateTimePicker2.Date:=
end;
DepositCalc();
end;
procedure TMainForm.GroupBox1MouseMove(
X, Y: Integer);
begin
{ if DateTimePicker1.Date<
then
begin
if SpinEdit2.Value mod 12 <>0 then
SpinEdit2.Value :=MonthsBetween(
end
else
begin
SpinEdit2.Value:=1;
DateTimePicker2.Date:=
end;
DepositCalc(); }
end;
procedure TMainForm.SpinEdit1Change(
begin
DepositCalc();
end;
procedure TMainForm.
begin
DepositCalc();
end;
procedure TMainForm.ComboBox2Change(
begin
DepositCalc();
end;
procedure TMainForm.
begin
DepositCalc();
end;
procedure TMainForm.
begin
DepositCalc();
end;
procedure TMainForm.FormCreate(Sender: TObject);
var
f:textfile;
begin
Assignfile (f, 'Config.txt');
Reset (f);
Readln (f,CONECT_STR);
closefile (f);
try
ADOConnection.ConnectionString := CONECT_STR;
except
application.MessageBox( 'База не найдена', 'Ошибка',MB_OK);
Информация о работе Разработка программного модуля начисления процентов