StartprogrammingusingObjectPascal:RestaurantProgram: Difference between revisions

From 흡혈양파의 번역工房
Jump to navigation Jump to search
(page 원복)
 
(번역수정)
Line 34: Line 34:
</syntaxhighlight>
</syntaxhighlight>


if 조건문을 사용하여 같은 프로그램을 작성한다면, 더 복잡하게 될 것이고, 복사한 코드를 포함하게 될 것입니다.
if 조건문을 사용하여 같은 프로그램을 작성한다면, 더 복잡하게 될 것이고, 코드가 중복 될 것입니다.


[[Category:StartprogrammingusingObjectPascal]]
[[Category:StartprogrammingusingObjectPascal]]

Revision as of 05:39, 4 April 2013

음식점 프로그램

var
    Meal: Byte;
begin
    Writeln('Welcome to Pascal Restaurant. Please select your order');
    Writeln('1 – Chicken (10$)');
    Writeln('2 – Fish (7$)');
    Writeln('3 – Meat (8$)');
    Writeln('4 – Salad (2$)');
    Writeln('5 - Orange Juice (1$)');
    Writeln('6 – Milk (1$)');
    Writeln;
    Write('Please enter your selection: ');
    Readln(Meal);

    case Meal of
        1: Writeln('You have ordered Chicken,',
            ' this will take 15 minutes');
        2: Writeln('You have ordered Fish, this will take 12 minutes');
        3: Writeln('You have ordered meat, this will take 18 minutes');
        4: Writeln('You have ordered Salad, this will take 5 minutes');
        5: Writeln('You have ordered Orange juice,',
            ' this will take 2 minutes');
        6: Writeln('You have ordered Milk, this will take 1 minute');
    else
        Writeln('Wrong entry');
    end;

    Write('Press enter key to close');
    Readln;
end.

if 조건문을 사용하여 같은 프로그램을 작성한다면, 더 복잡하게 될 것이고, 코드가 중복 될 것입니다.