Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 20_Task/M1/10_Variable/VariableForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

interface


uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
Expand All @@ -18,6 +19,7 @@ TForm1 = class(TForm)
// �� ��(����)������ ����ϴ� ������ �Լ��� ����

{ TODO : (1) ���� �� FSum ������ �����ϼ���. }
FSum:integer;

function AddNum(ANum: Integer): Integer;
public
Expand All @@ -36,7 +38,8 @@ function TForm1.AddNum(ANum: Integer): Integer;
{ TODO :
(2) FSum ������ �Ķ���� ANum ���� ���մϴ�.
FSum ���� ��ȯ }
Result := 0;
FSum := FSum + ANum;
result := FSum;
end;

procedure TForm1.Button1Click(Sender: TObject);
Expand Down
24 changes: 22 additions & 2 deletions 20_Task/M1/20_Function/FunctionForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ TForm2 = class(TForm)
��ȯ��: ���ڿ�(�޽���)
(2-2) �Լ� ���� �� Ctrl + Shift + C�� ���� ������ ����
}
function GetUserInfoMsg(AName: string; AAge: Integer; AIsMan: boolean): string;
public
// �ٸ� ���ֿ��� ������ �� �ִ� ������ �Լ� ����
end;
Expand Down Expand Up @@ -66,6 +67,12 @@ function TForm2.GetAgeMsg(AName: string; AAge: Integer): string;
���ڿ��� ������ ����(���ϱ�) �ϼ���.
������ ���ڷ� ��ȯ(IntToStr)�ϼ���.
}
if AAge >= 20 then
Adult := '����'
else
Adult := '�̼���';
Msg := GetNameMsg(AName); // �λ縻 ǥ�ô� ����
Msg := Msg + #13#10 + AName + '���� ' + inttostr(AAge) + '���� ' + Adult + '�Դϴ�.' ;

Result := Msg;
end;
Expand Down Expand Up @@ -103,16 +110,29 @@ procedure TForm2.Button3Click(Sender: TObject);
Name := edtName.Text;
Age := StrToInt(edtAge.Text);
IsMan := rdoMan.Checked;

MSg := GetUserInfoMsg(Name, Age, IsMan);
{ TODO :
(2) �λ縻 + ���ο��� Ȯ�� + ����Ȯ�� �޽�����
��ȯ�ϴ� �Լ�(GetUserInfoMsg)�� �ۼ��ϼ���
Msg := GetUserInfoMsg(Name, Age, IsMan);
}

ShowMessage(Msg);
end;

function TForm2.GetUserInfoMsg(AName: string; AAge: Integer;
AIsMan: boolean): string;
var
s,Msg:string;
begin
if AIsMan = True then
s := '����'
else
s := '����';
Msg := GetAgeMsg(AName, AAge );
Msg := Msg + #13#10 + AName + '���� ' + s + '�Դϴ�.' ;

result := Msg;
end;
{ TODO :
(2-2) GetUserInfoMsg �Լ��� �����ο���
�λ縻 + ���ο��� Ȯ�� + ����Ȯ�� �޽����� ��ȯ�ϵ��� �ۼ��ϼ���.
Expand Down
18 changes: 14 additions & 4 deletions 20_Task/M1/30_Array/ArrayForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ procedure TForm3.Button1Click(Sender: TObject);
Memo1.Lines.Clear;
Memo1.Lines.Add('�迭 ����');

for I := 0 to length(Fnumarr)-1 do
Memo1.Lines.Add(inttostr(FNumarr[I]));
{ TODO :
(1) for ���� �̿��� �迭�� ������ ����ϼ���.
�迭�� ũ�� ����ǵ� �����ϵ��� �ݺ��� ���� Length(FNumArr) - 1�� ����
Expand All @@ -75,7 +77,8 @@ function TForm3.GetArraySum: Integer;
begin
Sum := 0;
{ TODO : (2) for ���� �̿��� �迭�� ���� ��� ���� ��ȯ�ϵ��� ���� }

for I := 0 to length(Fnumarr)-1 do
Sum := Sum + Fnumarr[I];
Result := Sum;
end;

Expand All @@ -87,7 +90,9 @@ function TForm3.GetArrayMaxNum: Integer;
{ TODO :
(3) for ���� �̿��� �迭�� �� �� ���� ū ���� ��ȯ�ϵ��� ����
if ���� �̿��� ���ڸ� �� }

for I := 0 to length(Fnumarr)-1 do
if Fnumarr[I] >= MaxNum then
MaxNum := Fnumarr[I];
Result := MaxNum;
end;

Expand All @@ -104,8 +109,13 @@ procedure TForm3.Button2Click(Sender: TObject);
50 �̸�(<)�� ��� CountUnder 1 ���� �ϵ��� ����
}

Memo1.Lines.Add('50 �̻��� ���� ����: ' + IntToStr(CountOver));
Memo1.Lines.Add('50 �̸��� ���� ����: ' + IntToStr(CountUnder));
for I := 0 to length(Fnumarr)-1 do
if Fnumarr[I] >= 50 then
inc(CountOver)
else
inc(Countunder) ;
Memo1.Lines.Add('50 �̻��� ���� ����: ' + IntToStr(CountOver));
Memo1.Lines.Add('50 �̸��� ���� ����: ' + IntToStr(CountUnder));
end;

end.
23 changes: 23 additions & 0 deletions 20_Task/M2/Calculator.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
program Calculator;

uses
Vcl.Forms,
Mycal in 'Mycal.pas' {Cal},
Vcl.Themes,
Vcl.Styles,
Usplash in 'Usplash.pas' {SplashForm};

{$R *.res}

begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
SplashForm := TSplashForm.Create(Application);
TStyleManager.TrySetStyle('Sky');
SplashForm.show;
SplashForm.Refresh;
Application.CreateForm(Tcal, cal);
SplashForm.Hide;
SplashForm.Free;
Application.Run;
end.
625 changes: 625 additions & 0 deletions 20_Task/M2/Calculator.dproj

Large diffs are not rendered by default.

Binary file added 20_Task/M2/Calculator.res
Binary file not shown.
Loading