Write program in COBOL code A state allows state employees w

Write program in COBOL code:

A state allows state employees who are retiring to put money equal to the value of their unused sick leave into a fund to pay for health insurance. Write a program that allows the user to type in a retiring employee’s annual salary, and number of hours of accumulated sick leave. Then display the value of that sick leave so it may be placed into the insurance fund. Do the computations in a subroutine (calling program) that has the annual salary, number of sick leave hours, and insurance fund amount as arguments. Assume that a year has 2080 work hours.

There will be two programs. One is a main program and another with three arguments.

Solution

IDENTIFICATION DIVISION.
PROGRAM-ID. UTIL.

DATA DIVISION.
   LINKAGE SECTION.
   77 salary PIC 999999999.
   77 sickhours PIC 999999999.
   77 Ins_fund PIC 999999999.
   77 temp PIC 999999999.

PROCEDURE DIVISION USING salary, sickhours, Ins_fund.
DIVIDE salary BY 2080 GIVING temp.
MULTIPLY temp BY sickhours GIVING Ins_fund.
DISPLAY \' Insurance Fund :\' Ins_fund.
EXIT PROGRAM.

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.

DATA DIVISION.
   WORKING-STORAGE SECTION.
   77 salary PIC 999999999.
   77 sickhours PIC 999999999.
   77 Ins_fund PIC 999999999.
PROCEDURE DIVISION.
DISPLAY \' Enter Annual salary :\'.
ACCEPT salary.
DISPLAY \' Enter Sick leave hours :\'.
ACCEPT sickhours.
CALL \'UTIL\'USING salary, sickhours.
STOP RUN.

Write program in COBOL code: A state allows state employees who are retiring to put money equal to the value of their unused sick leave into a fund to pay for h

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site