Advertisement
electroduck

Centimeters to Inches

May 9th, 2015
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 0.58 KB | None | 0 0
  1. 000100 IDENTIFICATION DIVISION.
  2. 000200 PROGRAM-ID. HOMEWORK.
  3. 000300 DATA DIVISION.
  4. 000400 WORKING-STORAGE SECTION.
  5. 000500 01 IN-VAR    PIC X(10) VALUE '          '.
  6. 000600 01 CM        PIC S9(10) USAGE COMP.
  7. 000700 01 INCHES    PIC S9(10) USAGE COMP.
  8. 001000 PROCEDURE DIVISION.
  9. 001100     DISPLAY "CENTIMETERS TO INCHES PROGRAM".
  10. 001400     DISPLAY "ENTER HEIGHT IN CM: ".
  11. 001500     ACCEPT IN-VAR FROM CONSOLE.
  12. 001600     COMPUTE CM = FUNCTION NUMVAL(IN-VAR).
  13. 001700     DIVIDE 2.54 INTO CM GIVING INCHES.
  14. 001800     DISPLAY "HEIGHT IN INCHES: " INCHES.
  15. 003000     STOP RUN.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement