Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Consider the following: DATA DIVISION . WORKING - STORAGE SECTION . 01 WS - NUM1 PIC 9 ( 4 ) VALUE 10 . 01 WS - NUM2 PIC 9 ( 4 ) VALUE 10. 01 WS - NUM3 PIC 9 ( 4 ) VALUE 100. 01 WS - NUM4 PIC 9 ( 4 )...

1 answer below »

Consider the following:

DATA DIVISION.

WORKING-STORAGE SECTION.

01WS-NUM1 PIC9(4)VALUE10.

01WS-NUM2 PIC9(4)VALUE10.

01WS-NUM3 PIC9(4)VALUE100.

01WS-NUM4 PIC9(4)VALUE100.

01WS-NUMA PIC9(4)VALUE10.

01WS-NUMB PIC9(4)VALUE10.

01WS-NUMC PIC9(4)VALUE10.

01WS-NUMD PIC9(4)VALUE100.

01WS-NUME PIC9(4)VALUE10.

Using the data item list above, answer the following questions. Consider the initialized values as stated above for each question. (ie disregard the changes to data items from previous questions).

SUBTRACTWS-NUM1 WS-NUM2FROMWS-NUM3WS-NUM4.

  1. What are the following values after this statement?

WS-NUM1:

WS-NUM2:

WS-NUM3:

WS-NUM4:

ADDWS-NUM1 WS-NUM2TOWS-NUM3GIVINGWS-NUM4.

  1. What are the following values after this statement?

WS-NUM1:

WS-NUM2:

WS-NUM3:

WS-NUM4:

SUBTRACTWS-NUMA WS-NUMBWS-NUMCFROMWS-NUMDGIVINGWS-NUME.

  1. What are the following values after this statement?

WS-NUMA:

WS-NUMB:

WS-NUMC:

WS-NUMD:

WS-NUME:

MULTIPLYWS-NUMABYWS-NUMB WS-NUMC.

  1. What are the following values after this statement?

WS-NUMA:

WS-NUMB:

WS-NUMC:

WS-NUMD:

WS-NUME:

MULTIPLYWS-NUMABYWS-NUMBGIVINGWS-NUMC.

  1. What are the following values after this statement?

WS-NUMA:

WS-NUMB:

WS-NUMC:

WS-NUMD:

WS-NUME:

DIVIDEWS-NUMDBY7GIVINGWS-NUMAREMAINDERWS-NUMB.

  1. What are the following values after this statement?

WS-NUMA:

WS-NUMB:

WS-NUMC:

WS-NUMD:

WS-NUME:

COMPUTEWS-NUMC= (WS-NUM1 * WS-NUM2) - (WS-NUMA / WS-NUMB) +WS-NUM3.

  1. What are the following values after this statement?

WS-NUMC:

Exercise #2 (String Handling)

Consider the following:

DATA DIVISION.

WORKING-STORAGE SECTION.

01FIELD-1 PICX(10)VALUE"AAABBXBBAA".

01FIELD-2 PICX(10)VALUE"LastName".

  • FIELD-3 PICX(10)VALUE"FirstName".
  • FIELD-4 PICX(20)VALUE" ".

Using the data item list above, answer the following questions. Consider the initialized values as stated above for each question. (ie disregard the changes to data items from previous questions).

INSPECTFIELD-1REPLACINGFIRST"B"BY"Z".

  1. What are the following values after this statement?

FIELD-1:

INSPECTFIELD-1REPLACINGALL"B"BY"C".

  1. What are the following values after this statement?

FIELD-1:

STRINGFIELD-2DELIMITEDBYSIZE

FIELD-3DELIMITEDBYSPACE

INTOFIELD-4

ONOVERFLOWDISPLAY"OVERFLOW!"

END-STRING

  1. What are the following values after this statement?

FIELD-2:

FIELD-3:

FIELD-4:


Answered Same Day Aug 17, 2022

Solution

Aditi answered on Aug 17 2022
81 Votes
SOLUTION
Task 1
1. WS-NUM1: 0010
WS-NUM2: 0010
WS-NUM3: 0080
WS-NUM4: 0080

2. WS-NUM1: 0010
WS-NUM2: 0010
WS-NUM3: 0100
WS-NUM4: 0120

3. WS-NUMA: 0010
WS-NUMB: 0010
WS-NUMC: 0010
WS-NUMD: 0100
WS-NUME: 0070
4. WS-NUMA: 0010
WS-NUMB: 0100
WS-NUMC: 0100
WS-NUMD: 0100
WS-NUME:...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here