其他分享
首页 > 其他分享> > COBOL

COBOL

作者:互联网

COBOL (/ˈkoʊbɒl, -bɔːl/; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is imperative, procedural and, since 2002, it is an object-oriented language. COBOL is primarily used in business, finance, and administrative systems for companies and governments. COBOL is still widely used in applications deployed on mainframe computers, such as large-scale batch and transaction processing jobs. However, due to its declining popularity and the retirement of experienced COBOL programmers, programs are being migrated to new platforms, rewritten in modern languages or replaced with software packages. Most programming in COBOL is now purely to maintain existing applications; however, many large financial institutions were still developing new systems in COBOL as late as 2006 due to the mainframe processing speed.

In computer science, imperative programming is a programming paradigm that uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program consists of commands for the computer to perform. Imperative programming focuses on describing how a program operates.

The term is often used in contrast to declarative programming, which focuses on what the program should accomplish without specifying how the program should achieve the result.

Procedural programming is a programming paradigm, derived from imperative programming, based on the concept of the procedure call. Procedures (a type of routine or subroutine) simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself. The first major procedural programming languages appeared circa 1957–1964, including Fortran, ALGOL, COBOL, PL/I and BASIC. Pascal and C were published circa 1970–1972.

Computer processors provide hardware support for procedural programming through a stack register and instructions for calling procedures and returning from them. Hardware support for other types of programming is possible, but no attempt was commercially successful (for example Lisp machines or Java processors).

六级/考研单词: compile, compute, imperative, administer, deploy, batch, migrate, hardware, parcel, paradigm, mood, seldom, accomplish, derive, execute, stack, instruct

APPLICATION PROGRAMS & PROJECTS (ibmmainframes.com)

PROCEDURE DIVISION.
                            0001A.
                                     DISPLAY "ENTER 4 DIGIT YEAR >=0001 & <=9999".
                                     ACCEPT Y.
                            0002A.
                                     DISPLAY "ENTER MONTH(INTEGER)".
                                     ACCEPT M.
                                     IF M < 1 OR > 12 DISPLAY "INVALID MONTH" GO 0002A.
                            0003A.
                                     DISPLAY "ENTER DATE(INTEGER)".
                                     ACCEPT D.
                                     IF D < 1 OR > 31 DISPLAY "INVALID DATE" GO 0003A.
                                     MOVE D TO C.
                            0000X.
                                    COMPUTE A = FF ( I ).
                                    IF E = Y GO 0000Y.
                                    ADD 1 TO I.
                                    IF I > 7 COMPUTE I = 1.
                                    DIVIDE E BY 4 GIVING T REMAINDER B.
                                    IF E < Y AND B = 0 ADD 1 TO I.
                                    IF I > 7 COMPUTE I = 1.
                                    ADD 1 TO E.
View Code

标签:programming,languages,program,imperative,COBOL,DISPLAY
来源: https://www.cnblogs.com/funwithwords/p/15934187.html