CIS 3713LAST YEAR’SName: ______

RPG and Midrange ComputingExam 2exam2-Fall-2001.doc

Bodnovichpage 1 of 3

  1. (6 points) A program uses data from the STUDENT file to generate a printed report that reflects all the data in the file. The STUDENT record layout follows:

Student ID
(integer) / Student
Name
(character) / Phone
Number
(integer) / Major
Code
(character) / (unused) / Grade Point Average
(numeric;
2 decimal
places)
1 / 9 / 10 / 34 / 35 / 44 / 45 / 50 / 51 / 65 / 66 / 68

Complete the file specifications for this program for the STUDENT file. Assume that this file will be accessed with the READ command.

FFilenameIPE.F..Rlen...... Device

F______

FQPRINT O F 132 PRINTER

2.(23 points) Write the input specifications for the preceding problem.

IFilenameSqNORi PfromTo++Dfield+

I______

I ______

I ______

I ______

I ______

I ______

I ______

I ______

3.1 (14 points) Write the calculations to compute AMTDUE,
where AMTDUE = (UNITS x PRICE) + (SHIP x RATE). Round your result.
CLOn01n02n03Factor1+++OpCodFactor2+++ResultLenDH
C ______
C ______
C ______
C ______/ Score
Problem 1 ___ of 6
Problem 2___ of 23
Problem 3.1___ of 14
Problem 3.2___ of 17
Problem 3.3___ of 20
Problem 4___ of 20
Exam Total___ of 100

3.2(17 points) Write the calculations to convert a measurement in inches into one in yards, feet and inches (1 yard = 36 inches; 1 foot = 12 inches). For example 67 inches converts to 1 yard, 2 feet, and 7 inches; 37 inches converts to 1 yard, 0 feet, 1 inch.. Assume that the field TINCHS contains the measurement to be converted and has been previously defined as a 4-digit integer. No other fields have been previously defined.

IFilenameSqNORi PfromTo++Dfield+

I __11__140TINCHS

CLOn01n02n03Factor1+++OpCodFactor2+++ResultLenDH

C ______

C ______

C ______

C ______

C ______

C ______

3.3(20 points) Write the calculations with MOVE and MOVEL operations to insert a hyphen into a 9digit zip code, called ZIPPL4, creating a new field called NEWZIP. For example, if ZIPPL4 contains 445551234 then your operations will result in NEWZIP containing 445551234. You must define all fields other than ZIPPL4.

IFilenameSqNORi PfromTo++Dfield+

I __11__19_ZIPPL4

CLOn01n02n03Factor1+++OpCodFactor2+++ResultLenDH

C ______

C ______

C ______

C ______

C ______

C ______

C ______

C ______

C ______

4.(20 points) Heading lines of a printer spacing chart for an application follow:

1 2 3 4 5 6 7

1234567890123456789012345678901234567890123456789012345678901234567890

MM/DD/YY EXAM 2 PAGE NNN

STUDENT NAME SCORE

Code the output specifications for the preceding printer spacing chart. Assume that the output file is named QPRINT, MM/DD/YY represents the current date, and NNN is the page number. The output is printed by the following calculation specification:

CEXCPT HEADS

OName++++DFBASbSa Field+YBEnd+PConstant/editword+++++++++

O______202 ______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______

O______