อาจารเค้าบอกว่า ตอนเลือก เมนู ที่มี 6 ข้อ อ่ะคับ มันออกโปรแกรมตั้งแต่ตอนนั้นเลยไม่ได้
ต้องกดเลือก เมนูก่อน ถึงจะเลือก Y or N ได้อ่ะคับ
พอจะมีวิธีไห้มีเมนู 7.exit กดแล้วออกเลย ไม่ต้องถาม Y or N ได้มั้ยคับ
welcome my program
please select menu
1...........
2...........
3...........
4...........
5...........
6...........
7. exit <<<< อะไรประมาณนี้อ่ะคับ
พอกดเลข 7 แล้วออกจากโปรแกรมเลย อ่ะคับ
program test01;
uses crt;
var num,mon:byte;
chr,ans:char;
a,b,usd,yuro,pound,yen,youn,won,spd,keeb,kyat,hkd,dong,bath:real;
year:integer;
begin
repeat
clrscr;
textcolor(10);
gotoxy(7,2);
writeln('------------------------------------------------------------------');
gotoxy(25,4);
writeln('===============================');
gotoxy(25,5);
writeln('||');
gotoxy(54,5);
writeln('||');
gotoxy(25,6);
writeln('===============================');
gotoxy(50,11);
writeln(' (_/) (_/)');
gotoxy(50,12);
writeln(' (^ ^) (^ ^)');
gotoxy(50,13);
writeln('(")_(")(")_(")');
textcolor(13);
gotoxy(15,5);
writeln('(/")');
textcolor(13);
gotoxy(15,6);
writeln(' / ');
textcolor(13);
gotoxy(15,7);
writeln(' " ');
textcolor(10);
gotoxy(7,3);
writeln('|');
gotoxy(7,4);
writeln('|');
gotoxy(7,5);
writeln('|');
gotoxy(7,6);
writeln('|');
gotoxy(7,7);
writeln('|');
gotoxy(7,8);
writeln('|');
gotoxy(7,9);
writeln('|');
gotoxy(7,10);
writeln('|');
gotoxy(7,11);
writeln('|');
gotoxy(7,12);
writeln('|');
gotoxy(7,13);
writeln('|');
gotoxy(7,14);
writeln('|');
gotoxy(7,15);
writeln('|');
gotoxy(7,16);
writeln('|');
gotoxy(7,17);
writeln('|');
gotoxy(7,18);
writeln('|');
gotoxy(7,19);
writeln('|');
gotoxy(7,20);
writeln('|');
gotoxy(7,21);
writeln('|');
gotoxy(7,22);
writeln('|');
gotoxy(7,23);
writeln('|');
gotoxy(72,3);
writeln('|');
gotoxy(72,4);
writeln('|');
gotoxy(72,5);
writeln('|');
gotoxy(72,6);
writeln('|');
gotoxy(72,7);
writeln('|');
gotoxy(72,8);
writeln('|');
gotoxy(72,9);
writeln('|');
gotoxy(72,10);
writeln('|');
gotoxy(72,11);
writeln('|');
gotoxy(72,12);
writeln('|');
gotoxy(72,13);
writeln('|');
gotoxy(72,14);
writeln('|');
gotoxy(72,15);
writeln('|');
gotoxy(72,16);
writeln('|');
gotoxy(72,17);
writeln('|');
gotoxy(72,18);
writeln('|');
gotoxy(72,19);
writeln('|');
gotoxy(72,20);
writeln('|');
gotoxy(72,21);
writeln('|');
gotoxy(72,22);
writeln('|');
gotoxy(72,23);
writeln('|');
gotoxy(7,23);
writeln('------------------------------------------------------------------');
textcolor(;
gotoxy(73,4);
writeln('--');
gotoxy(11,24);
writeln('|');
gotoxy(74,5);
writeln('|');
gotoxy(74,6);
writeln('|');
gotoxy(74,7);
writeln('|');
gotoxy(74,8);
writeln('|');
gotoxy(74,9);
writeln('|');
gotoxy(74,10);
writeln('|');
gotoxy(74,11);
writeln('|');
gotoxy(74,12);
writeln('|');
gotoxy(74,13);
writeln('|');
gotoxy(74,14);
writeln('|');
gotoxy(74,15);
writeln('|');
gotoxy(74,16);
writeln('|');
gotoxy(74,17);
writeln('|');
gotoxy(74,18);
writeln('|');
gotoxy(74,19);
writeln('|');
gotoxy(74,20);
writeln('|');
gotoxy(74,21);
writeln('|');
gotoxy(74,22);
writeln('|');
gotoxy(74,23);
writeln('|');
gotoxy(74,24);
writeln('|');
gotoxy(11,25);
writeln('----------------------------------------------------------------');
textcolor(9);
gotoxy(30,4);
writeln ('welcom to my program');
writeln;
textcolor(11);
gotoxy(22,9);
writeln ('please select manu');
writeln;
textcolor(13);
gotoxy(18,11);
writeln('1.menu temperature');
textcolor(7);
gotoxy(18,12);
writeln('2.menu money');
textcolor(;
gotoxy(18,13);
writeln('3.menu geomatry');
textcolor(2);
gotoxy(18,14);
writeln('4.menu year');
textcolor(1);
gotoxy(18,15);
writeln('5.menu left year');
textcolor(12);
gotoxy(18,16);
writeln('6.game');
writeln;
textcolor(10);
gotoxy(18,18);
write('enter your choice:');
readln(num);
writeln;
clrscr;
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;
end;
2:begin
writeln('1.us dollar');
writeln('2.Yuro');
writeln('3.pound');
writeln('4.Yen(100)');
writeln('5.Youn');
writeln('6.won(1000)');
writeln('7.dollar singapore');
write('select ');
readln(mon);
clrscr;
case mon of
1:begin
write('enter us dollar');
readln(usd);
bath:=usd*33.34;
writeln('=bath ',bath:2:2);
end;
2:begin
write('enter Yuro');
readln(yuro);
bath:=yuro*48.56;
writeln('=bath ',bath:2:2);
end;
3:begin
write('enter bound');
readln(pound);
bath:=pound*53.81;
writeln('=bath ',bath:2:2);
end;
4:begin
write('enter yen(100)');
readln(yen);
bath:=yen*35/100;
writeln('=bath ',bath:2:2);
end;
5:begin
write('enter youn');
readln(youn);
bath:=youn*4.93;
writeln('=bath ',bath:2:2);
end;
6:begin
write('enter won(1000)');
readln(won);
bath:=won*35/1000;
writeln('=bath ',bath:2:3);
end;
7:begin
write('enter dollar singapore');
readln(spd);
bath:=spd*24.17;
writeln('=bath ',bath:2:2);
end;
end;
end;
5:begin
write('In Put Your Year = ');
readln(year);
clrscr;
if (Year mod 4 = 0)
and ((Year mod 100 <> 0)
or (Year mod 400 = 0)) then
writeln ('Leaf Year')
else
writeln ('Not Leaf Year');
end;
end;
write('continue Y or N:');
ans:=readkey;
ans:= upcase(ans);
until ans='N';
end.
ต้องกดเลือก เมนูก่อน ถึงจะเลือก Y or N ได้อ่ะคับ
พอจะมีวิธีไห้มีเมนู 7.exit กดแล้วออกเลย ไม่ต้องถาม Y or N ได้มั้ยคับ
welcome my program
please select menu
1...........
2...........
3...........
4...........
5...........
6...........
7. exit <<<< อะไรประมาณนี้อ่ะคับ
พอกดเลข 7 แล้วออกจากโปรแกรมเลย อ่ะคับ
program test01;
uses crt;
var num,mon:byte;
chr,ans:char;
a,b,usd,yuro,pound,yen,youn,won,spd,keeb,kyat,hkd,dong,bath:real;
year:integer;
begin
repeat
clrscr;
textcolor(10);
gotoxy(7,2);
writeln('------------------------------------------------------------------');
gotoxy(25,4);
writeln('===============================');
gotoxy(25,5);
writeln('||');
gotoxy(54,5);
writeln('||');
gotoxy(25,6);
writeln('===============================');
gotoxy(50,11);
writeln(' (_/) (_/)');
gotoxy(50,12);
writeln(' (^ ^) (^ ^)');
gotoxy(50,13);
writeln('(")_(")(")_(")');
textcolor(13);
gotoxy(15,5);
writeln('(/")');
textcolor(13);
gotoxy(15,6);
writeln(' / ');
textcolor(13);
gotoxy(15,7);
writeln(' " ');
textcolor(10);
gotoxy(7,3);
writeln('|');
gotoxy(7,4);
writeln('|');
gotoxy(7,5);
writeln('|');
gotoxy(7,6);
writeln('|');
gotoxy(7,7);
writeln('|');
gotoxy(7,8);
writeln('|');
gotoxy(7,9);
writeln('|');
gotoxy(7,10);
writeln('|');
gotoxy(7,11);
writeln('|');
gotoxy(7,12);
writeln('|');
gotoxy(7,13);
writeln('|');
gotoxy(7,14);
writeln('|');
gotoxy(7,15);
writeln('|');
gotoxy(7,16);
writeln('|');
gotoxy(7,17);
writeln('|');
gotoxy(7,18);
writeln('|');
gotoxy(7,19);
writeln('|');
gotoxy(7,20);
writeln('|');
gotoxy(7,21);
writeln('|');
gotoxy(7,22);
writeln('|');
gotoxy(7,23);
writeln('|');
gotoxy(72,3);
writeln('|');
gotoxy(72,4);
writeln('|');
gotoxy(72,5);
writeln('|');
gotoxy(72,6);
writeln('|');
gotoxy(72,7);
writeln('|');
gotoxy(72,8);
writeln('|');
gotoxy(72,9);
writeln('|');
gotoxy(72,10);
writeln('|');
gotoxy(72,11);
writeln('|');
gotoxy(72,12);
writeln('|');
gotoxy(72,13);
writeln('|');
gotoxy(72,14);
writeln('|');
gotoxy(72,15);
writeln('|');
gotoxy(72,16);
writeln('|');
gotoxy(72,17);
writeln('|');
gotoxy(72,18);
writeln('|');
gotoxy(72,19);
writeln('|');
gotoxy(72,20);
writeln('|');
gotoxy(72,21);
writeln('|');
gotoxy(72,22);
writeln('|');
gotoxy(72,23);
writeln('|');
gotoxy(7,23);
writeln('------------------------------------------------------------------');
textcolor(;
gotoxy(73,4);
writeln('--');
gotoxy(11,24);
writeln('|');
gotoxy(74,5);
writeln('|');
gotoxy(74,6);
writeln('|');
gotoxy(74,7);
writeln('|');
gotoxy(74,8);
writeln('|');
gotoxy(74,9);
writeln('|');
gotoxy(74,10);
writeln('|');
gotoxy(74,11);
writeln('|');
gotoxy(74,12);
writeln('|');
gotoxy(74,13);
writeln('|');
gotoxy(74,14);
writeln('|');
gotoxy(74,15);
writeln('|');
gotoxy(74,16);
writeln('|');
gotoxy(74,17);
writeln('|');
gotoxy(74,18);
writeln('|');
gotoxy(74,19);
writeln('|');
gotoxy(74,20);
writeln('|');
gotoxy(74,21);
writeln('|');
gotoxy(74,22);
writeln('|');
gotoxy(74,23);
writeln('|');
gotoxy(74,24);
writeln('|');
gotoxy(11,25);
writeln('----------------------------------------------------------------');
textcolor(9);
gotoxy(30,4);
writeln ('welcom to my program');
writeln;
textcolor(11);
gotoxy(22,9);
writeln ('please select manu');
writeln;
textcolor(13);
gotoxy(18,11);
writeln('1.menu temperature');
textcolor(7);
gotoxy(18,12);
writeln('2.menu money');
textcolor(;
gotoxy(18,13);
writeln('3.menu geomatry');
textcolor(2);
gotoxy(18,14);
writeln('4.menu year');
textcolor(1);
gotoxy(18,15);
writeln('5.menu left year');
textcolor(12);
gotoxy(18,16);
writeln('6.game');
writeln;
textcolor(10);
gotoxy(18,18);
write('enter your choice:');
readln(num);
writeln;
clrscr;
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;
end;
2:begin
writeln('1.us dollar');
writeln('2.Yuro');
writeln('3.pound');
writeln('4.Yen(100)');
writeln('5.Youn');
writeln('6.won(1000)');
writeln('7.dollar singapore');
write('select ');
readln(mon);
clrscr;
case mon of
1:begin
write('enter us dollar');
readln(usd);
bath:=usd*33.34;
writeln('=bath ',bath:2:2);
end;
2:begin
write('enter Yuro');
readln(yuro);
bath:=yuro*48.56;
writeln('=bath ',bath:2:2);
end;
3:begin
write('enter bound');
readln(pound);
bath:=pound*53.81;
writeln('=bath ',bath:2:2);
end;
4:begin
write('enter yen(100)');
readln(yen);
bath:=yen*35/100;
writeln('=bath ',bath:2:2);
end;
5:begin
write('enter youn');
readln(youn);
bath:=youn*4.93;
writeln('=bath ',bath:2:2);
end;
6:begin
write('enter won(1000)');
readln(won);
bath:=won*35/1000;
writeln('=bath ',bath:2:3);
end;
7:begin
write('enter dollar singapore');
readln(spd);
bath:=spd*24.17;
writeln('=bath ',bath:2:2);
end;
end;
end;
5:begin
write('In Put Your Year = ');
readln(year);
clrscr;
if (Year mod 4 = 0)
and ((Year mod 100 <> 0)
or (Year mod 400 = 0)) then
writeln ('Leaf Year')
else
writeln ('Not Leaf Year');
end;
end;
write('continue Y or N:');
ans:=readkey;
ans:= upcase(ans);
until ans='N';
end.