Posts Tagged ‘programming’

cal tax [ โค้ดโปรแกรมคำนวณภาษี ]

02/06/2012

มีโค้ดโปรแกรมคำนวณภาษีที่จดไว้

โปรดอย่าถามว่าเป็นโค้ดของโปรแกรมอะไร เพราะจำไม่ได้และจำไม่ได้ว่าเขียนเสร็จหรือไม่

แต่สามารถเอาไปเขียนออกมาเป็นตัวโปรแกรม และแก้ไขได้ตามอัธยาศัย

“ผิดพลาดตรงไหน ไม่รับผิดชอบ”

============================================================

Program Calculate_Tax 2;

Ans: chars;

begin clrscr;

repeat

writeln (‘Enter net income:’);

readln (NetIncome);

if NetIncome <= 15000 then

Tax: = NetIncome*0.05

else

Tax: = (5000*0.05) + (NetIncome – 15000)*0.10;

writeln (‘For income’, Net income);

writeln (‘The tax is’, Tax:0:2);

repeat

writeln (‘Test again ? (Y/N)’);

readln (Ans) ;

until (Upcase (Ans) = ‘Y’) or (Upcase (Ans) = ‘N’);

until Upcase (Ans) = ‘N’

writeln (‘End of program.’);

end