Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

PROGRAM OF EVALUATE GENDER FROM USER AND PRINT ACCORDINGLY

Posted By: Vitoria Silva     Category: Cobol     Views: 3515

PROGRAM OF EVALUATE GENDER FROM USER AND PRINT ACCORDINGLY WHTHER HE/SHE IS MALE OR FEMALE, PROGRAM IS ALLOW TO ENTER "m","male","1".

Code for PROGRAM OF EVALUATE GENDER FROM USER AND PRINT ACCORDINGLY in Cobol

       IDENTIFICATION DIVISION.
        PROGRAM-ID. evalgender.

       DATA DIVISION. 
        WORKING-STORAGE SECTION.
         01 gender PIC x(6).
          88 MALE value"m","male","0".
          88 FEMALE value"f","female","1".

       PROCEDURE DIVISION.
        para1.
           DISPLAY "ENTER GENDER".
           ACCEPT gender.

           EVALUATE true
             WHEN MALE DISPLAY "YOUR GENDER IS MALE"     
             WHEN FEMALE DISPLAY "YOUR GENDER IS FEMALE"
             WHEN OTHER DISPLAY "INVALID GENDER TYPE"
           END-EVALUATE.
           STOP RUN. 

******************************************************************
ENTER GENDER
m
YOUR GENDER IS MALE

ENTER GENDER
1
YOUR GENDER IS FEMALE

ENTER GENDER
4
INVALID GENDER TYPE
******************************************************************
  
Share: 



Vitoria Silva
Vitoria Silva author of PROGRAM OF EVALUATE GENDER FROM USER AND PRINT ACCORDINGLY is from Salvador, Brazil.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!