      PROGRAM WAGES
************************************************************************
* Program to calculate weekly pay for an employee.  Salaried employees *
* receive 1/52 of their annual salaries.  Other employees are paid on  *
* an hourly basis with overtime hours paid at 1.5 times the regular    *
* hourly rate.  Identifiers used are:                                  *
*     EMTYPE      : employee type (S or H)                             *
*     SALARY      : annual salary (for salaried employees)             *
*     HOURS, RATE : hours worked and hourly rate (for hourly employees)*
*     OVMULT      : multiplier for overtime pay                        *
*     PAY         : employee's pay                                     *
*                                                                      *
* Input:  EMTYPE                                                       *
*         SALARY for salaried employees, or                            *
*         HOURS and RATE for hourly employees                          *
* Output: PAY                                                          *
************************************************************************

      CHARACTER EMTYPE
      REAL OVMULT, SALARY, HOURS, RATE, PAY
      PARAMETER (OVMULT = 1.5)

* Get employee type (S or H)
      PRINT *, 'ENTER THE TYPE OF EMPLOYEE (''S'' OR ''H''):'
      READ *, EMTYPE

* Select appropriate method of calculating pay:
      IF (EMTYPE .EQ. 'S') THEN

*         Salaried employee
          PRINT *, 'ENTER EMPLOYEE''S ANNUAL SALARY:'
          READ *, SALARY
          PAY = SALARY / 52
      ELSE

*         Hourly employee
          PRINT *, 'ENTER HOURS WORKED AND HOURLY RATE:'
          READ *, HOURS, RATE
          IF (HOURS .GT. 40.0) THEN
              PAY = 40.0 * RATE + OVMULT * RATE * (HOURS - 40.0)
          ELSE
              PAY = HOURS * RATE
          END IF
      END IF

* Display emmployee's pay
      PRINT *, 'EMPLOYEE''S PAY IS ', PAY

      END
