Thread: Urgent help please

1. Junior Techie
Join Date
Feb 2006
Posts
108
Rep Power
0

Urgent help please

Really need help writing this:

Pasccal code that input the employee ID, name, health institution of each employee, their position, and their gross salary. Calculate each employees total deuctions and net salary using the following information:

Deduction or tax are calculated as follows:

PAYE: 15% of salary that is above 30,000, otherwise its 8% for salary below 30,000

NIS:3% of salary for all employees

NHT:4% for salary less than 25,000 and 5% for gross greater than or equal to 25,000

Print each employees ID,name, gross salary , total deduction, and net salary. Use arrays to store and retireve relevant information.
Print above info as a report for all employees

2. So want us to write your homework for you?

3. Junior Techie
Join Date
Feb 2006
Posts
108
Rep Power
0
truth be told is a good friends cxc sba , i never did pascal just c++, but programming language are for the most similiar but i dont know the syntax for pascal . thats why i'm here seekign help

4. dude if u did c++ n u were any good @ all u can write that.....just pree some tuts on pascal n u should be fine....my bro did it in 6th form n he is a n^^b to programming n he learned n wrote his in less than a week.....youtube is your friend bredren

5. Junior Techie
Join Date
Feb 2006
Posts
108
Rep Power
0
Heres is what they had , but got syntax error;I have no problem learning the syntax but this is due tomorrow thats why i thought i would seek some assistance from the techies. PLEASE ANY HELP and i would be grateful.

Program salaries;
Var
gross_sal:array[1..65]of real;
PAYE:real;
NIS:real;
NHT:real;
Total_ded:array[1..65] of real;
Net_sal:array[1..65] of real;
Health_Ins:array[1..65] of string;
position:array[1..65]of string;
name:array[1..65]of string;
ID:array[1..65] of string;
count:integer;
Begin
writeln('A program that accepts employee Health_Ins,position,gross_sal,ID,name.Calculate and output each name,ID, gross_sal,Total_ded and Net_sal');
For count:=1 to 65 do;
Begin
Write ('Enter employee ID');
Read (ID[count]);
Write ('Enter employee name');
Read (name[count]);
Write ('Enter the Health_Ins of employee');
Read (Health_Ins[count]);
Write ('Enter the position of employee');
Read (position[count]);
Write ('Enter the gross_sal of employee');
Read (gross_sal[count]);
IF gross_sal[count]>30000 THEN
PAYE:=0.15*gross_sal[count]
ELSE
PAYE:=0.08*gross_sal[count];
NIS:=0.03*gross_sal[count];
IF (gross_sal[count]<25000) THEN
NHT:=0.04*gross_sal[count]
ELSE
NHT:=0.05*gross_sal[count];
Total_ded[count]:=PAYE+NHT+NIS;
Net_sal[count]:=gross_sal[count] - Total_ded[count];
End;
count:=1;
While count<=65 do
Begin
Write ('employee ID is,'ID[count]);
Write ('gross_salary is,'gross_sal[count]);
Write ('Total_ded is,'Total_ded[count]);
Write ('Net_sal is,'Net_sal[count]);
Write ('employee name is,'name[count]);
count:=count+1;
End;
Readln;
End.

6. Techie
Join Date
May 2003
Posts
229
Rep Power
0
You must have figured out the syntax errors by now, but I'll answer anyway.

I compiled this program and got syntax errors in the Write statements at the end of the program. Basically, you need to move the commas (,) from inside the strings. For example:

Write("employee IS is,'ID[count]);

is incorrect because the , is inside the string. The comma inside the string is just going to be treated like any other character and written to the standard output stream. It has to be outside the string in order to be a separator, like this:

Write("employee IS is',ID[count]);

7. Junior Techie
Join Date
Feb 2006
Posts
108
Rep Power
0
ok thanks boss gonna try that . nuff respect

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•