home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / busi / payday11.zip / PAYDAY.PAS < prev   
Pascal/Delphi Source File  |  1990-08-06  |  2KB  |  67 lines

  1. program PayDay;
  2. {William Sanchez
  3. Lab Assignment #2
  4. Payroll calculation program
  5. July 30, 1990
  6. Pascal Senior}
  7.  
  8. var
  9.  employee : string[7];   {define variables}
  10.  Hours,
  11.  payrate,
  12.  grosspay : real;
  13.  ch : char;
  14.  
  15. Begin
  16.  clrscr;     {clear the screen}
  17.  Writeln;
  18.  Writeln('                         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
  19.  Writeln('                         $            PAYDAY!           $');
  20.  writeln('                         $  Payroll Calculation Program $');
  21.  writeln('                         $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
  22.  writeln;
  23.  ch := 'y';          {define ch as 'y'}
  24.  while ch='y' do     {set condition for loop}
  25.   begin
  26.    hours := 0;
  27.    payrate := 0;      {initialize values as zero}
  28.    grosspay :=0;
  29.    Writeln;
  30.    Write ('Enter 7-Digit Alpha-Numerical Employee Code: ');
  31.    readln(employee);
  32.    Write ('Enter Number of Hours Worked: ');     {request input}
  33.    readln(hours);
  34.    Write ('Enter Employee Payrate: ');
  35.    readln(payrate);
  36.    If hours <=40 Then
  37.     begin                                    {calculation for pay for 40}
  38.      Grosspay := hours * payrate;             {hours or less}
  39.     end
  40.    Else                                      {calcuations for 40+ hours}
  41.     begin
  42.      Grosspay := (hours - 40) * (1.5 * payrate) + (40 * payrate);
  43.     end;
  44.    Writeln ('Employee ',employee, ' has made: $',grosspay:9:2); {output gross pay...format to 9 digits+2decimal}
  45.    write (Chr(7));               {beep}
  46.    Writeln;
  47.     repeat
  48.      write('Calculate another salary? (y/n)');
  49.      readLN (ch);                               {request input for loop}
  50.     Until ch IN ['y', 'n'];
  51.    writeln;
  52.   end;
  53.  clrscr; {clear the screen}
  54.  writeln;
  55.  writeln;
  56.  writeln('Thank You for using...');
  57.  delay(1000);     {pause for 1 second}
  58.  Writeln;
  59.  writeln;
  60.  writeln;
  61.  writeln;
  62.  writeln;
  63.  writeln ('                           $$$$$$$$$$$$$$$$$');
  64.  writeln ('                           $    PAYDAY!    $');
  65.  writeln ('                           $$$$$$$$$$$$$$$$$');
  66. End.
  67.