<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'URgent help needed' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'URgent help needed' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 22:43:31 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 22:43:31 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>URgent help needed</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426874/426874/urgent-help-needed/</link>
      <description>URGENT PROJEct help needed, first time attempting Pascal please help.&lt;br /&gt;
&lt;br /&gt;
Develop a pascal programm that input employee ID , name, the health institution, of each employee , their position and their gross salary. Calculate each employee's total deductions and their net salary using the following information:&lt;br /&gt;
&lt;br /&gt;
Deductions or tax are calculated as follows:&lt;br /&gt;
&lt;br /&gt;
PAYE: 15% of salary that is above 30,000, otherwise its 8% for salary below 30,000&lt;br /&gt;
&lt;br /&gt;
NIS: 3% of salary for all employees&lt;br /&gt;
&lt;br /&gt;
NHT: 4% for salary less than 25,000 and 5% for gross greater than or equal to 25,000&lt;br /&gt;
&lt;br /&gt;
Print each emploees ID , Name , Gross Salary , Total Deduction and Net Salary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heres what i tried so far but have a syntax error and cant fix:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Program salaries;&lt;br /&gt;
Var&lt;br /&gt;
gross_sal:array[1..65]of real;&lt;br /&gt;
PAYE:real;&lt;br /&gt;
NIS:real;&lt;br /&gt;
NHT:real;&lt;br /&gt;
Total_ded:array[1..65] of real;&lt;br /&gt;
Net_sal:array[1..65] of real;&lt;br /&gt;
Health_Ins:array[1..65] of string;&lt;br /&gt;
position:array[1..65]of string;&lt;br /&gt;
name:array[1..65]of string;&lt;br /&gt;
ID:array[1..65] of string;&lt;br /&gt;
count:integer;&lt;br /&gt;
Begin&lt;br /&gt;
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');&lt;br /&gt;
For count:=1 to 65 do;&lt;br /&gt;
Begin&lt;br /&gt;
Write ('Enter employee ID');&lt;br /&gt;
Read (ID[count]);&lt;br /&gt;
Write ('Enter employee name');&lt;br /&gt;
Read (name[count]);&lt;br /&gt;
Write ('Enter the Health_Ins of employee');&lt;br /&gt;
Read (Health_Ins[count]);&lt;br /&gt;
Write ('Enter the position of employee');&lt;br /&gt;
Read (position[count]);&lt;br /&gt;
Write ('Enter the gross_sal of employee');&lt;br /&gt;
Read (gross_sal[count]);&lt;br /&gt;
IF gross_sal[count]&amp;gt;30000 THEN&lt;br /&gt;
PAYE:=0.15*gross_sal[count]&lt;br /&gt;
ELSE&lt;br /&gt;
PAYE:=0.08*gross_sal[count];&lt;br /&gt;
NIS:=0.03*gross_sal[count];&lt;br /&gt;
IF (gross_sal[count]&amp;lt;25000) THEN&lt;br /&gt;
NHT:=0.04*gross_sal[count]&lt;br /&gt;
ELSE&lt;br /&gt;
NHT:=0.05*gross_sal[count];&lt;br /&gt;
Total_ded[count]:=PAYE+NHT+NIS;&lt;br /&gt;
Net_sal[count]:=gross_sal[count] - Total_ded[count];&lt;br /&gt;
End;&lt;br /&gt;
count:=1;&lt;br /&gt;
While count&amp;lt;=65 do&lt;br /&gt;
Begin&lt;br /&gt;
Write ('employee ID is,'ID[count]);&lt;br /&gt;
Write ('gross_salary is,'gross_sal[count]);&lt;br /&gt;
Write ('Total_ded is,'Total_ded[count]);&lt;br /&gt;
Write ('Net_sal is,'Net_sal[count]);&lt;br /&gt;
Write ('employee name is,'name[count]);&lt;br /&gt;
count:=count+1;&lt;br /&gt;
End;&lt;br /&gt;
Readln;&lt;br /&gt;
End.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426874/426874/urgent-help-needed/</guid>
      <pubDate>Wed, 18 Jan 2012 17:37:18 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: URgent help needed</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426874/426875/re-urgent-help-needed/#426875</link>
      <description>You are using up all your memory.  You are trying to hold all the information for 65 employees in memory at once.  Write the program so that you are dealing with data for only one employee at a time.&lt;br /&gt;
&lt;br /&gt;
If you must have all that data in memory at one time then try reducing the size of the strings.  A string takes up 256 bytes. An array [1 .. 65] or string takes up 16640 bytes, about a quarter available for Turbo Pascal.&lt;br /&gt;
&lt;br /&gt;
None of these seven variables really needs 256 bytes of memory.  If &lt;strong&gt;ID&lt;/strong&gt; is the social security number then you only need declare it as &lt;strong&gt;string&amp;#91;9&amp;#93;&lt;/strong&gt;.  For &lt;strong&gt;name&lt;/strong&gt; you can probably get along with &lt;strong&gt;string&amp;#91;30&amp;#93;&lt;/strong&gt;.  Likewise for &lt;strong&gt;Health_Ins&lt;/strong&gt; and &lt;strong&gt;position&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
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 &lt;span style="color: Red;"&gt;string[30]&lt;/span&gt;;  
   position:array[1..65]of &lt;span style="color: Red;"&gt;string[30]&lt;/span&gt;;
   name:array[1..65]of &lt;span style="color: Red;"&gt;string[30]&lt;/span&gt;;
   ID:array[1..65] of &lt;span style="color: Red;"&gt;string[9]&lt;/span&gt;;
   count:integer;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426874/426875/re-urgent-help-needed/#426875</guid>
      <pubDate>Wed, 18 Jan 2012 19:44:13 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: URgent help needed</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426874/426878/re-urgent-help-needed/#426878</link>
      <description>: You are using up all your memory.  You are trying to hold all the &lt;br /&gt;
: information for 65 employees in memory at once.  Write the program &lt;br /&gt;
: so that you are dealing with data for only one employee at a time.&lt;br /&gt;
: &lt;br /&gt;
: If you must have all that data in memory at one time then try &lt;br /&gt;
: reducing the size of the strings.  A string takes up 256 bytes. An &lt;br /&gt;
: array [1 .. 65] or string takes up 16640 bytes, about a quarter &lt;br /&gt;
: available for Turbo Pascal.&lt;br /&gt;
: &lt;br /&gt;
: None of these seven variables really needs 256 bytes of memory.  If &lt;br /&gt;
: &lt;strong&gt;ID&lt;/strong&gt; is the social security number then you only need declare &lt;br /&gt;
: it as &lt;strong&gt;string&amp;#91;9&amp;#93;&lt;/strong&gt;.  For &lt;strong&gt;name&lt;/strong&gt; you can &lt;br /&gt;
: probably get along with &lt;strong&gt;string&amp;#91;30&amp;#93;&lt;/strong&gt;.  Likewise &lt;br /&gt;
: for &lt;strong&gt;Health_Ins&lt;/strong&gt; and &lt;strong&gt;position&lt;/strong&gt;.&lt;br /&gt;
: &lt;br /&gt;
: Good luck.&lt;br /&gt;
: &lt;br /&gt;
:  &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;: 
: 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 &lt;span style="color: Red;"&gt;string[30]&lt;/span&gt;;  
:    position:array[1..65]of &lt;span style="color: Red;"&gt;string[30]&lt;/span&gt;;
:    name:array[1..65]of &lt;span style="color: Red;"&gt;string[30]&lt;/span&gt;;
:    ID:array[1..65] of &lt;span style="color: Red;"&gt;string[9]&lt;/span&gt;;
:    count:integer;
: &lt;/pre&gt;: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hey thanks for the quick response really appreciate it but could this be the reason for syntax error at line 44? Where the output statements are?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426874/426878/re-urgent-help-needed/#426878</guid>
      <pubDate>Thu, 19 Jan 2012 00:13:33 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: URgent help needed</title>
      <link>http://www.programmersheaven.com/mb/pasprog/426874/426882/re-urgent-help-needed/#426882</link>
      <description>&lt;br /&gt;
You need a comma after the single quote, not before it.&lt;br /&gt;
&lt;br /&gt;
I take it you are not getting an error on line 16?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/426874/426882/re-urgent-help-needed/#426882</guid>
      <pubDate>Thu, 19 Jan 2012 10:09:40 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>
