Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

Program to Draws an ellipse or a circle, when h_rad=v_rad, filled with one color

Posted By: Anna Schmidt     Category: Cobol     Views: 4251

Program to Draws an ellipse (or a circle, when h_rad=v_rad), filled with one color

Code for Program to Draws an ellipse or a circle, when h_rad=v_rad, filled with one color in Cobol

IDENTIFICATION DIVISION.
PROGRAM-ID. Test_DRAW_DISC.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 VGA16-MODE       PIC X(10) VALUE "VGA16".
77 TEXT-MODE        PIC X(10) VALUE "TEXT".
77 STATUS-CODE      PIC X.

01 COLOURS.
   02 BLACK         PIC 9(4) COMP VALUE 0.
   02 DARK_BLUE     PIC 9(4) COMP VALUE 1.
   02 DARK_GREEN    PIC 9(4) COMP VALUE 2.
   02 DARK_CYAN     PIC 9(4) COMP VALUE 3.
   02 DARK_RED      PIC 9(4) COMP VALUE 4.
   02 DARK_MAGENTA  PIC 9(4) COMP VALUE 5.
   02 BROWN         PIC 9(4) COMP VALUE 6.
   02 LIGHT_GRAY    PIC 9(4) COMP VALUE 7.
   02 DARK_GRAY     PIC 9(4) COMP VALUE 8.
   02 LIGHT_BLUE    PIC 9(4) COMP VALUE 9.
   02 LIGHT_GREEN   PIC 9(4) COMP VALUE 10.
   02 LIGHT_CYAN    PIC 9(4) COMP VALUE 11.
   02 LIGHT_RED     PIC 9(4) COMP VALUE 12.
   02 LIGHT_MAGENTA PIC 9(4) COMP VALUE 13.
   02 YELLOW        PIC 9(4) COMP VALUE 14.
   02 WHITE         PIC 9(4) COMP VALUE 15.

77 x      PIC 9(4) COMP.
77 y      PIC 9(4) COMP.
77 h_rad  PIC 9(4) COMP.
77 v_rad  PIC 9(4) COMP.

PROCEDURE DIVISION.
MAIN.
   CALL "SET_VIDEO_MODE" USING VGA16-MODE STATUS-CODE
   IF STATUS-CODE = "Y"
      MOVE 320 TO x0
      MOVE 200 TO y0
      MOVE 100 TO h_rad
      MOVE  50 TO v_rad
      CALL "DRAW_ELLIPSE" USING BY VALUE x, BY VALUE y,
                                BY REFERENCE h_rad, BY REFERENCE v_rad,
                                BY REFERENCE LIGHT_BLUE,
                                BY REFERENCE DARK_GREEN
      ACCEPT FOO
      CALL "SET_VIDEO_MODE" USING TEXT-MODE STATUS-CODE
   END-IF
  
Share: 



Anna Schmidt
Anna Schmidt author of Program to Draws an ellipse or a circle, when h_rad=v_rad, filled with one color is from Frankfurt, Germany.
 
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!