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
4 changes: 3 additions & 1 deletion 20_Task/M1/10_Variable/VariableForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TForm1 = class(TForm)
// �� ��(����)������ ����ϴ� ������ �Լ��� ����

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

function AddNum(ANum: Integer): Integer;
public
Expand All @@ -36,7 +37,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
379 changes: 378 additions & 1 deletion 20_Task/M1/10_Variable/VariableSample.dproj

Large diffs are not rendered by default.

Binary file modified 20_Task/M1/10_Variable/VariableSample.res
Binary file not shown.
35 changes: 34 additions & 1 deletion 20_Task/M1/20_Function/FunctionForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ TForm2 = class(TForm)
private
// �� ��(����)���� ����ϴ� ������ �Լ��� ����
function GetNameMsg(AName: string): string;

function GetAgeMsg(AName: string; AAge: Integer): string;
function GetUserInfoMsg(AName: string; AAge: integer; isMan: Boolean): string;
{ TODO :
(2-1) GetUserInfoMsg �Լ��� ����
�Ķ����: �̸�(����), ����(����), ���ڿ���(Boolean)
Expand Down Expand Up @@ -66,10 +66,42 @@ function TForm2.GetAgeMsg(AName: string; AAge: Integer): string;
���ڿ��� ������ ����(���ϱ�) �ϼ���.
������ ���ڷ� ��ȯ(IntToStr)�ϼ���.
}
if AAge >= 20 then
begin
Msg := Msg + AName + '�� �� ���̴� ' + IntToStr(AAge) + '�� �����Դϴ�.';
end
else
begin
Msg := Msg + AName + '���� ������ �ƴմϴ�.'
end;

Result := Msg;
end;

function TForm2.GetUserInfoMsg(AName: string; AAge: integer;
isMan: Boolean): string;
var
Msg: string;
begin
Msg := GetAgeMsg(AName, AAge);
Msg := Msg + #13#10;

if rdoMan.Checked then
begin
isMan := true;
Msg := Msg + AName + '���� �����Դϴ�.';
end
else
begin
isMan := false;
Msg := Msg + AName + '���� �����Դϴ�.';
end;

Result := Msg;
end;



procedure TForm2.Button1Click(Sender: TObject);
var
Name, Msg: string;
Expand Down Expand Up @@ -109,6 +141,7 @@ procedure TForm2.Button3Click(Sender: TObject);
��ȯ�ϴ� �Լ�(GetUserInfoMsg)�� �ۼ��ϼ���
Msg := GetUserInfoMsg(Name, Age, IsMan);
}
Msg := GetUserInfoMsg(Name, Age, IsMan);

ShowMessage(Msg);
end;
Expand Down
Loading