cobol-interpreter-lab/lab-2/LANGUAGE.md

1.1 KiB

Language Proposal

1. Hello World

  • source used: Cobol Emulator

  • display the text "Hello World!" in the terminal

  • https://www.tutorialspoint.com/cobol/cobol_program_structure.htm this website has useful information about the structure of the cobol language

  • the Identification Division is mandatory for all programs and sub divisions have unique sentences within them and determine what is done with variables or IO in this example

    Input

      there is no input for this example
    

    Output

      the string "Hello World!" is sent to output via the included DISPLAY function
    

2. Quadratic Function

  • Note: code needs to be formatted

  • credit to Marco Biagini

  • a quadratic equation of the form ax^2 + bx + c = 0

    Input

      User will be prompted for a, b, and c (ex. 1, 5, 6)
    

    Output

    Program will display the real roots or if there are no real roots (ex. -2, -3)
    

3. Integer Sort

4. Language Features