0% found this document useful (0 votes)
33 views9 pages

COBOL - Advanced Program PDF

hello

Uploaded by

domingo.pjade16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views9 pages

COBOL - Advanced Program PDF

hello

Uploaded by

domingo.pjade16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Technological University of the Philippines -

Manila College of Science

ADVANCED PROGRAM USING

COBOL PROGRAMMING LANGUANGE

Payroll System

Prof: Edward Cruz

Course/ Section: BSCS - 2B

Submitted by:

Cuevas, Maverick Ivan

Domingo, Princess Jade


Payroll System With File Handling

SOURCE CODE:
IDENTIFICATION DIVISION.

PROGRAM-ID.
AdvancedPayrollSystemWithFiles.

DATA DIVISION.

FILE SECTION.

FD Employee-File.

01 Employee-Record.

05 Employee-Name PIC X(20).

05 Hours-Worked PIC 9(3).

05 Hourly-Rate PIC 9(5)V99.

05 Weekly-Salary PIC 9(6)V99.

05 Overtime-Hours PIC 9(3).

05 Regular-Salary PIC 9(6)V99.

05 Overtime-Salary PIC 9(6)V99.


FD Output-File.

01 Output-Record PIC X(80).

WORKING-STORAGE SECTION.

01 WS-EOF PIC X VALUE


'N'.

01 Total-Employees PIC 9(3)


VALUE 0.

01 Total-Payroll PIC 9(7)V99


VALUE 0.

01 More-Employees PIC X
VALUE 'Y'.

PROCEDURE DIVISION.

Begin.

OPEN INPUT Employee-File

OPEN OUTPUT Output-File


PERFORM UNTIL WS-EOF = 'Y'

READ Employee-File

AT END

MOVE 'Y' TO WS-EOF

NOT AT END

ADD 1 TO Total-Employees

PERFORM Compute-Salary

PERFORM Write-Output-
Record

END-PERFORM

DISPLAY "Total Employees: " Total-


Employees

DISPLAY "Total Payroll: " Total-


Payroll
CLOSE Employee-File

CLOSE Output-File

STOP RUN.

Compute-Salary.

IF Hours-Worked > 40

COMPUTE Overtime-Hours =
Hours-Worked - 40

COMPUTE Regular-Salary = 40 *
Hourly-Rate

COMPUTE Overtime-Salary =
Overtime-Hours * (Hourly-Rate * 1.5)

COMPUTE Weekly-Salary =
Regular-Salary + Overtime-Salary

ELSE

COMPUTE Weekly-Salary =
Hours-Worked * Hourly-Rate

END-IF
ADD Weekly-Salary TO Total-
Payroll.

Write-Output-Record.

STRING

"Employee Name: " Employee-


Name DELIMITED BY SIZE

" Regular Salary: " Regular-


Salary DELIMITED BY SIZE

" Overtime Salary: " Overtime-


Salary DELIMITED BY SIZE

" Weekly Salary: " Weekly-Salary


DELIMITED BY SIZE

INTO Output-Record

END-STRING

WRITE Output-Record.

OUTPUT:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy