View previous topic :: View next topic
|
Author |
Message |
richie
New User
Joined: 11 Jun 2005 Posts: 24
|
|
|
|
Hi,
Please let me know the answers and explanations of the
following 3 questions:
a)The smallest negative dollar amount with a dollar in the output that can be edited Through the picture string -$$$$ is
1) ?1000
2) ?9999
3) ?999
4) ?100
b)The DATA DIVISION Entries are
01 REC-1.
02 A PIC 9(4)V99 VALUE 4567.50
02 B PIC 99V9 VALUE 45.2.
01 REC-2.
02 C PIC ZZZ9.99
02 D PIC 99.99.
What will be the content in REC2 after the execution of MOVE REC-1 TO REC-2.
c)IF NOT AGE LESS THAN 30 AND 40
GO TO PARA-AGE-MIDDLES.
The controls will go to the paragraph named PARA-AGE-
MIDDLE.
(a) if AGE is greater than or equal to 40.
(b) If AGE is greater than or equal to 30.
(c) If AGE is greater than or equal to 30 but less than 40
(d) If AGE is less than or equal to 30.
Thanks |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
a) First
4) ?100
b) Second
456750452
c) Third
(a) if AGE is greater than or equal to 40. |
|
Back to top |
|
|
vrexy
New User
Joined: 19 May 2005 Posts: 7 Location: bangalore
|
|
|
|
Hi,
which one z smallest?? -1 or -2 ???? I thought -9999 z right answer for first query.
cheers,
rexy. |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
There is more to the second question than meets the eye. First, remember you are moving a 9 character alphanumeric field (REC-1) to a 12 character alphanumeric field (REC-2). Therefore REC-2 will be 456750452 followed by three spaces. This is because in REC-1 the decimal point is implied and doesn't take up any space, whereas in REC-2 the decimal points are seen as characters in the alphanumeric item REC-2. So, the 2 decimal points plus the two field sizes gives us a total of 12 characters and since the receiving field is alphanumeric and bigger than the sending field the data in the receiving field is padded on the right hand side with spaces. But even before this, for the code to compile there must be a full stop after the value of field A. |
|
Back to top |
|
|
gsnvsr
New User
Joined: 06 Jul 2005 Posts: 40
|
|
|
|
For the first question, I believe -9999 is the correct answer..
Best regards,
prasad |
|
Back to top |
|
|
rssomm
New User
Joined: 05 Jun 2005 Posts: 41 Location: Hyderabad
|
|
|
|
Please find answers below.
a)-999
b) 456750452BBB where B stands for Blank
c)The question can be interpreted as If Age not less than 30 and Age less than 40. So the answer would be C i.e If AGE is greater than or equal to 30 but less than 40.
Thank You.
Madhu |
|
Back to top |
|
|
|