COBOL

2022/2/25 6:28:47

本文主要是介绍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

这篇关于COBOL的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程