In this article I would like to share with you a sample program that I wrote using Pascal as my language of choice. I called this program Payroll Program in Turbo Pascal. What does the program will do is to ask the user the name of the employee and then it will ask the number of days work. After which the program will compute the salary of the employee. I am using Turbo Pascal 6 For DOS as my compiler in writing this program.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
Program Payroll;
Uses Crt;
Const rate = 5.50;
Var employee : string;
days : integer;
total : real;
Begin
Clrscr;
Writeln('Payroll Program in Pascal');
Writeln;
Write('Give Employees Name :');
Readln(employee);
Write('Give Number of Days Worked : ');
Readln(days);
Total := (days * rate);
Writeln;
Write('Display Payroll Result');
Writeln;
Writeln;
Write('Employees Name : ' ,employee);
Writeln;
Write('For ',days:2, ' days of work, you have earned $');
Write(total:5:2);
Writeln;
Writeln;
Write('End of Program');
Readln;
End.
magangdang
ReplyDelete