Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with these COBOL problems please. 05 FLD-1 PIC 9(3) VALUE 123. 05 FLD-2 PIC 9(3) VALUE 222. 05 FLD-3 PIC 9(2) VALUE 10.

Need help with these COBOL problems please.

05 FLD-1 PIC 9(3) VALUE 123.

05 FLD-2 PIC 9(3) VALUE 222.

05 FLD-3 PIC 9(2) VALUE 10.

05 FLD-4 PIC 9(3) VALUE 100.

05 FLD-5 PIC 9(2) VALUE 22.

05 FLD-6 PIC 9(4) VALUE 1111.

Given the values in the fields above, answer question 1 and 2

1. COMPUTE FLD-2 ROUNDED = FLD-5 / FLD-4 + FLD-3

Result in FLD-2 will be _____

2> SUBTRACT FLD-3 FLD-4 FLD-5 FROM FLD-2

Result in FLD-2 will be _____

3. In order to DISPLAY a record on the monitor

a) the record and the associated file must be defined in the FD paragraph

b) the SELECT ASSIGN statements must be coded to identify the file

c) the record must be moved from WORKING-STORAGE SECTION to the output record name in the File Section.

d) all of the above are required

e) none of the above are required

4. With the PERFORM UNTIL structure in COBOL, the test for the condition expression, by default, takes place

a) before the specified procedure is executed

b) while the specified procedure is executed

c) as the last statement in the executed procedure

d) as the first statement in the executed procedure

e) depends on how you spell PERFORM

5. Code the COBOL code required to handle the following logical statement. Assume all field declarations have been made with the field names noted.

The gas efficiency of a car (GAS-EFF) has to be calculated as the liters consumed (LTRS) divided by the distance traveled (DIST) multiplied by 100. When the calculated gas efficiency is less than or equal to 5, the phrase EXCELLENT is displayed on the monitor.

Given the code below, predict what values will be displayed.

Identification division. program-id. my-first-program.

data division.

working-storage section.

01 field-definitions.

05 root pic 9(1) value 0.

05 square pic 9(3) value 0.

procedure division.

perform table-procedure 4 times.

stop run.

table-procedure.

add 2 to root.

display root square.

compute square = root ** 2.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions