Example of constructing an arithmetic expression, COBOL Programming

Assignment Help:

Example of constructing an arithmetic expression:

An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators.

Illustrations of the valid arithmetic expressions are:

1230_Rules for constructing an Arithmetic Expression2.png

Note that whenever the right-hand side of a COMPUTE verb is a single identifier or literal, then the effect is that of a MOVE statement.

Illustration:

                       COMPUTE    A = B + C

 

has similar effect as that of the ADD B  C  GIVING  A

Illustration:

                       COMPUTE     F =   1.8 * C + 32

The value of the expression on the right-hand side is computed and this value is then moved to the F.  Assume that the C & F are defined with pictures 99 & ZZ9.9 respectively and the present value of C is 3.  Subsequently after the execution of the statement, the F will have the value 37.4.


Related Discussions:- Example of constructing an arithmetic expression

Second form of divide verb, Second form of Divide verb: The second for...

Second form of Divide verb: The second form of this verb is as shown below: In this situation the identifier-1 or numeric- literal-1 will be divided by identifier-2 or

Program for electricity bill, PROGRAM FOR ELECTRICITY BILL: An electri...

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

Read statement, READ STATEMENT: The aim of this verb is to make availa...

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

Group item as operand in the relational condition, Group Item as Operand in...

Group Item as Operand in the Relational Condition: Whenever an operand of a relational condition is the group item, the item is then considered to be an alphanumeric field. Th

Environment division - cobol programming, Environment Division: The En...

Environment Division: The Environment Division is the second division in the COBOL source program. It is mainly machine-dependent . The computer and all the peripheral dev

File description for the relative and indexed files, File Description for t...

File Description for the Relative and Indexed Files: The FD entry for a relative or an indexed file is similar to that of a sequential file. Some compilers do not permit varia

Add verb, ADD VERB: The ADD Verb can be used to find the sum of two or ...

ADD VERB: The ADD Verb can be used to find the sum of two or more numbers and to store the sum.  The ADD verb takes any one of the two forms as shown below:

Programs for redefines clause , PROGRAMS FOR REDEFINES CLAUSE: We have...

PROGRAMS FOR REDEFINES CLAUSE: We have to write a simple program to explain the REDEFINES clause at 01 level. identification division. program- id. Redef. environment

Open statement - sequential files, OPEN statement: We know that the pr...

OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP

Arithmetic verbs, ARITHMETIC VERBS: Most of the problems need some com...

ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd