Friday, August 12, 2016

Checking Age in Cobol

Here is a simple program that I wrote entirely in COBOL that shows how to use if statement. This program will ask the user's and then our program will check and determine whether the user is an adult or a minor. The code is very simple and easy to understand.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.



My mobile number here in the Philippines is 09173084360.




Sample Program Output
 
 
Program Listing
 
******************************************************************
* Author: MR. JAKE R. POMPERADA,MAED-IT
* Date: AUGUST 12, 2016
* Purpose: AGE CHECKER PROGRAM IN COBOL
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. AGE_CHECKER.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 AGE PIC 9(4).
PROCEDURE DIVISION.
PARA.
DISPLAY "CHECKING AGE IN COBOL".
DISPLAY "".
DISPLAY "WHAT IS YOUR AGE?".
ACCEPT AGE.
IF AGE >=18 THEN
DISPLAY "YOU ARE ALREADY AN ADULT.".
IF AGE < 18 THEN
DISPLAY "SORRY YOU ARE STILL A MINOR.".
STOP RUN.

 

1 comment:

  1. I have read your blog its very attractive and impressive. I like it your blog.

    kajal agarwal hot

    ReplyDelete