admin ดูโปรแกรมให้ผมหน่อยคับ ขอบคุนมากคับ

ผมลองทำแล้วแต่ไม่ประสบคาวมสำเร็จอ่ะ คับ

ลองยกตัวอย่างโปรแกรมด้วย ก้อ ดีนะคับ

ขอบคุณมากๆๆๆคับ

💬 การตอบกลับ 5

#1
Moshi
Moshi
16,996 โพสต์
ไม่ต้องตั้งกระทู้ใหม่เร่ื่อยๆ ก็ได้นะครับ กระทู้เดิมผมก็ไปตอบ

คนใหม่ที่มาดูเค้าจะงง ละก็ตั้งกันมั่วซั่ว

http://www.it4x.com/forum/index.php?topic=1138.15

เนี่ยครับ หน้านี้ก็มีโปรแกรมเป็นเมนู

จากนั้นตรงโค๊ด

'1' : writeln('1');
'2' : writeln('2');
'3' : writeln('3');

ก็เปลี่ยนเป็น writeln('1'); เป็น Begin กับ end; แล้วก็ละเลงโปรแกรมเลยครับ
#2
Robo_kub
Robo_kub
7 โพสต์
ขอโทดแบบรู้สึกผิดสุดุคับ
#3
Robo_kub
Robo_kub
7 โพสต์
พี่คับ ผมเอาไปทำดูแล้ว  แต่มัน คอมไพล์ ไม่ได้อ่ะคับ

ไม่รู้ว่ามันผิดตรงไหน  (โปรแกรมอันนี้ ยังไม่เสร็จนะคับ ยังต้องเขียนอีกเยอะ)

อันที่จริงผมก้ออยู่ ปวช. เหมือนกันนะคับ

program test01;
uses    crt;
var    num:byte;
        chr,ans:char;
        a,b:real;
begin
    repeat
    clrscr;
    textcolor(red);
    writeln ('welcom to my program');
    writeln;
    textcolor(yellow);
    writeln ('please select manu');
    writeln;
    textcolor(blue);
    writeln('1.manu temperature');
    textcolor(green);
    writeln('2.manu money');
    textcolor(red);
    writeln('3.manu triangle');
    textcolor(blue);
    writeln('4.manu year');
    textcolor(red);
    writeln('5.manu left year');
    textcolor(blue);
    writeln('6.game');
    writeln;
    write('enter your choice:');
    readln(num);
    writeln;
    case num of
    1:begin
            write('select tump c ro f');
            readln(chr);
            case chr of
                'C','c' : begin
                          write('temp in c');
                          read(a);
                          b:=a*9/5+32;
                          writeln('temp in faren',b:2:2);
                          end;
                'F','f' : begin
                          write('temp in c');
                          read(a);
                          a:=b*9/5+32;
                          writeln('temp in faren',a:2:2);
                          end;
            end;
   

    write('continue Y or N');
    ans:=readkey;
    ans:=upcase(ans);
    until ans='N';
    readln;
    end;
end.

อันนี้แค่ทดสอบเฉยๆนะคับ ย้ำ แค่ทดสอบเฉยๆคับ

อย่าหัวเราะเยอะนะคับ
#4
Moshi
Moshi
16,996 โพสต์
แก้ให้แล้วนะครับ ดูเอานะว่าผิดตรงไหน

program test01;
uses    crt;
var    num:integer;
        chr,ans:char;
        a,b:real;
begin
    repeat
    clrscr;
    textcolor(red);
    writeln ('welcom to my program');
    writeln;
    textcolor(yellow);
    writeln ('please select manu');
    writeln;
    textcolor(blue);
    writeln('1.manu temperature');
    textcolor(green);
    writeln('2.manu money');
    textcolor(red);
    writeln('3.manu triangle');
    textcolor(blue);
    writeln('4.manu year');
    textcolor(red);
    writeln('5.manu left year');
    textcolor(blue);
    writeln('6.game');
    writeln;
    write('enter your choice: ');
    readln(num);
    clrscr;

case num of
    1 : begin
                        write('select tump c ro f : ');
            readln(chr);
            case chr of
                'C','c' : begin
                        write('temp in c :');
                          readln(a);
                          b:=a*9/5+32;
                          writeln('temp in faren',b:2:2);
                                  end;
'F','f' : begin
                          write('temp in c : ');
                          readln(a);
                          a:=b*9/5+32;
                          writeln('temp in faren',a:2:2);
                            end;
end;
                    end;
        end;


    write('continue Y or N');
    ans:=readkey;
    ans:=upcase(ans);
    until ans='N';
end.
#5
Robo_kub
Robo_kub
7 โพสต์
ขอบคุนคับ