program salary C************************************************************************ C Read in the hourly rate and number of hours worked from prompted C input to determing gross salary* C C *Account for a $25 deduction for any gross salary exceeding $100 C *Account for overtime C*********************************************************************** C-----DECLARE VARIABLES real hlyrate, numhrs, gross, deduc, ot real othrs, nonothrs C-----ASSIGN CONSTANTS ot = 40.0 C-----PROMPT AND GET INPUTS write(*, 1000) 1000 format('Enter hourly rate: ',$) read *, hlyrate write(*,1001) 1001 format('Enter number of hours worked this week: ',$) read *, numhrs C-----EXTRA CREDIT: CALCULATE NUMBER OF OVER TIME HOURS if(numhrs.gt.ot) then othrs = numhrs - ot nonothrs = ot else othrs = 0.0 nonothrs = numhrs end if C-----CALCULATE INITIAL GROSS SALARY gross = (nonothrs * hlyrate) + (othrs * hlyrate * 1.5) C-----ADJUST FOR DEDUCTION IF NECESSARY if(gross.gt.100) then deduc = 25.0 gross = gross - deduc else deduc = 0.0 end if C-----CALCULATE INITIAL GROSS SALARY gross = (nonothrs * hlyrate) + (othrs * hlyrate * 1.5) - deduc C-----PRINT RESULTS print *, 'Hourly rate is: ', hlyrate print *, 'Number of non-OT hours worked is: ', nonothrs print *, 'Number of OT hours worked is: ', othrs print *, 'Amount of deduction is: ', deduc print *, 'Your gross salary for this week is: ', gross stop end