Menu
CoddyTech

Hours and Rate

Part of the Data and Numbers section of Coddy's COBOL Programming journey. Lesson 20 of 23.

challenge icon

Challenge

Easy

A payroll starts from a timesheet. Read EMP-NAME, HOURS and RATE, compute REG-PAY with MULTIPLY and GIVING, and display Employee: with the name, then Regular:   with the pay through MONEY-OUT.

Example input, one line per ACCEPT: Ada Lovelace, 40, 18.50.

Try it yourself

       IDENTIFICATION DIVISION.
       PROGRAM-ID. PAYROLL.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 EMP-NAME PIC X(12).
       01 HOURS PIC 9(3).
       01 RATE PIC 9(4)V99.
       01 REG-PAY PIC 9(5)V99.
       01 MONEY-OUT PIC $$$,$$9.99.
       PROCEDURE DIVISION.
           *> Read EMP-NAME, HOURS and RATE
           *> Compute REG-PAY and display both lines
           STOP RUN.

All lessons in Data and Numbers