School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,155 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,542 people online right now. Registration is fast and FREE... Join Now!




Pascal parse errors

 

Pascal parse errors, I can't find what I'm doing wrong with this code

dr_worm

22 Feb, 2007 - 09:27 PM
Post #1

D.I.C Head
**

Joined: 11 Sep, 2006
Posts: 139



Thanked: 2 times
My Contributions
I've looked this over up and down and I honestly can't figure out what I'm doing wrong. I've fixed some errors but these are eluding me.

CODE
Program Pay(input,output);

const   wage=9.73;            {declares constant wage}
        sstax=0.06;            {declares constant sstax}
        fitax=0.14;            {declares constant fitax}
        sitax=0.05;            {declares constant sitax}
        utax=6;            {declares constant utax}

var     hours,            {declares integer varible hours}
        dependants: integer;        {declares integer varible dependents}
        grosspay,            {declares real varible grosspay}
        netpay,            {declares real varible netpay}
        withholding: real;        {declares real varible withholding}


   procedure input(var hours,dependants:integer);    {establishes precedure for the input values}

   begin

      writeln('How many hours did you work this week?');    {asks user for hours of work}
      readln(hours);                    {records hours of work}

      writeln('How many dependants do you have?');        {asks user for number of dependants}
      readln(dependants);                {records number of dependants}

   end;


   procedure calculation(var hours,dependants:integer;var grosspay,netpay,withholding:real);   {establishes procedure for the calculations of pay}

   begin  

      if hours>40 then    {uses if statment to figure out gross pay and net pay if you worked over 40hrs}
        
         begin
         grosspay:= ((wage*40)+(1.5*(hours-40)))
         netpay:= (grosspay-(grosspay*sstax*fitax*sitax)-utax)
         end

      else    {if you worked 40hrs of less}
        
         begin
         grosspay:= (wage*40)
         netpay:= (grosspay-(grosspay*sstax*fitax*sitax)-utax)
         end;
  
      if dependants>=3 then    {changes netpay if you have more than three dependants}
        
         netpay:=grosspay-10;      

   withholding:=netpay-grosspay;    {calculates the difference between gross pay and net pay}
  
   end;

  
   procedure output(grosspay,netpay,withholding:real);    {establishes procedure to output the findings}

   begin

      writeln('Your gross pay for the week is ',grosspay);    {outputs the gross pay}
      writeln('Your net pay for the week is ', netpay);        {outputs the net pay}
      writeln('Your weeks withholding is' ,withholding);        {outputs the withholding}

   end;

Begin        {MAIN PROGRAM}

   input(hours,dependants);                {calls input procedure}
   calculation(hours,dependants,grosspay,netpay,withholding);    {calls calculation procedure}
   output(grosspay,netpay,withholding);            {calls the output procedure}

End.

I'll prolly kick myself when I figure it out.

User is offlineProfile CardPM
+Quote Post


Posts in this topic
dr_worm   Pascal parse errors   22 Feb, 2007 - 09:27 PM
qdoom   What kind of errors are you getting? I tried compi...   23 Feb, 2007 - 05:25 AM

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 05:32PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month