WI04 CIS314 QUIZ#1

 

NAME______________________________________________      GRADE _______/50.0

Create a code with a max length of 5 for posting your grades           CODE____________

 

Directions:  If you have a question, please raise your hand.  If an answer is not legible, it will be counted incorrect.  Remain seated until the quizzes are collected. 

 

à (25 pts) Circle T(rue) or F(alse) in answer to the following statements:

 

T          F         Paragraphs and statements can be coded on a single line.

T          F         SECTION is a valid user-defined data name.

T          F          COBOL stands for Computer Business Oriented Language.

T          F         Area B includes columns 12-80.

T          F         Within a record description, when one field is subordinate to another field, the subordinate field is coded using a lower level number.

T          F         COBOL reserve words are considered case sensitive.

T          F         The Identification Division has no effect on the execution of the program.

T          F         A hyphen is a valid character to help in the creation of user-defined data names and, in fact, can be the only characters in a user-defined data name as long as there are at least 2 hyphens in a row (i.e. just one hyphen can’t be a user-defined data name since that single character denotes an arithmetic operation).

T          F         A numeric literal may include commas.

T          F         FILE-SECTION is considered a valid data name.

T          F         A group item does not always have to be further subdivided.

T          F         You must always open input files before you open output files.

T          F         The Data Division can never directly follow the Identification Division

T          F         An independent item can be either a group item or an elementary item.

T          F         Nothing in a COBOL program is considered case sensitive.

T          F         The OPEN statement actually accesses the file and points to the first record.

T          F         The SELECT statement is in the PROCEDURE division.

T          F         The MOVE statement can move a variable name value to a literal.

T          F         The WRITE statement uses the FD name.

T          F         The AFTER advancing on the WRITE statement means that the printer will advance the print head then write the data.

T          F         The READ statement fills the input record buffer area with one record of information from the input file using the FD name.

T          F         The AT END clause only gets executed when the end of the file is detected.

T          F         The PERFORM statement executes the paragraph only when the condition is TRUE.

T          F         The ACCEPT OMITTED statement pauses the execution of the program and must always be coded directly before the STOP RUN statement.

T          F         The STOP RUN statement is always the last physical line in a COBOL program.


à (20 pts)  The following is a record with length 70.  Create the input buffer code using the following list of positions and variable names, which are at the end of each line under the RULES.  Be sure to list ALL the variable names as shown under the RULE section.

 

RECORD:  KathrynbbbM.Reevesbbbbb1254bShadowbDrbbbbbOrlandobbbbFL327514078432928

 

RULES:

The first 23 positions in the record is the full-name.

The next 37 positions is the address.

The next 10 positions is the phone-number.

 

Also,

The first 10 positions in the record is the first-name. 

The next 2 positions is the middle-name. 

The next 11 positions is the last-name. 

The next 19 positions is the street-address.

The next 11 positions is the city.

The next 2 positions is the state.

The next 5 positions is the zip-code.

The next 3 positions is area-code.

The next 3 positions is the first-3-digits-of-phone-num.

The last 4 positions is the second-4-digits-of-phone-num.

 

 

 

 

 

 

 

 

 

 

 

 

 

à (5 pts)  Given the page header  CIS314 Quiz#1 Grades and using a record length of 80, write the working storage information that will center the page header given the following statement: 

WRITE PRINT-REC FROM PAGE-HEADER AFTER ADVANCING 0 LINES.