How To Make Employee Salary Program With Pascal
Hello guys, this time I will discuss a bit about Turbo Pascal.
Turbo Pascal is a software development system composed of compilers and integrated development environments. In this post we will learn how to create an employee salary program that includes several things such as employee class, marital status and number of children.
Read more, just start our tutorial. First open Turbo Pascal and create a new project, here I use Turbo Pascal 7. Here's how it looks
Enter the following code:
program employee_salary;
uses crt;
var name:string;
kids_count:integer;
cat,question,married:char;
child,wife,salary:real;
const tax = 0.05;
label top;
begin
top:
clrscr;
write('Input Your Name = ');readln(name);
write('Input Category = ');readln(cat);
if cat = 'A' then
begin
salary:=3000000;
end
else if cat = 'B' then
begin
salary:=2000000;
end
else
begin
salary:=1000000;
end;
writeln('Your Basic Salary ',salary:0:0);
writeln('=================================');
write('Married ? (y/n) = ');readln(married);
if married = 'y' then
begin
wife:=0.1*salary;
writeln('Your Wifes Allowance = ',wife:0:0);
writeln('=======================================');
write('Kids Count = ');readln(kids_count);
child := (0.05*salary)*kids_count;
writeln('Your Child Support = ',child:0:0);
end
else
begin
wife:=0;
child:=0;
end;
writeln('=======================================');
writeln('Employee name = ',name);
writeln('Your Gross Salary = ',salary+wife+child:0:0);
writeln('Your Net Salary = ',(salary+wife+child) - (salary+wife+child)*tax:0:0,' With Tax 5%');
writeln('==================================================');
write('Input Employee Data Again (y/n) = ');readln(question);
if question = 'y' then
begin
goto top;
end
else
end.
MORE ARTICLE
Create Flat Splash Screen In VB.Net
PROGRAM STRUCTURE :
- You will be prompted to enter a name and category
- If category A then salary 3,000,000, B 2,000,000 and C 1,000,000
- Will directly display your salary nominally
- Are you married ? If Yes then
- Your wife's allowance is 10% of your salary.
- If you have children then the allowance is 5% of your salary * the number of your child
- If not married then do not get child support and wife
- Direct program displays your total gross salary
- Then under it will appear your net salary is (Gross Salary) - (Gross Salary * Taxes)
- Next comes the question of whether to input data again.