COBOL Programming with VSCode Coursera Quiz Answers

Week 01: COBOL Programming with VSCode Coursera Quiz Answers

Quiz 01: Welcome to COBOL

Q1. The B in COBOL stands for:

Q2. What implementation of COBOL typically runs on IBM Z Mainframe computers?

  • COBOL 3000
  • Enterprise COBOL
  • MegaCOBOL
  • COBOL for Workgroups

Quiz 02: VSCode and Extensions

Q1. Vertical lines in your COBOL editor are called:

  • Margins
  • Lanes
  • Rulers
  • Gutters

Q2. The bar across the top of your editor that shows information about where in the code you are currently positioned is called the:

  • Trapdoor Instance
  • Pipeline Option
  • Breadcrumb View
  • Branch Sifter

Q3. VS Code gives us some nice features that will help in writing code. Which of the following is NOT one of those features?

  • Code Completion
  • References and Diagnostics
  • Context Inversion
  • Hover Text

Quiz 03: Basic COBOL Syntax

Q1. Columns 8-11 make up what section of a COBOL line of code?

  • A Area
  • B Area
  • Creation Area
  • Descriptor Area

Q2. Words that the compiler has a special meaning for are known as _________

  • Casters
  • Reserved Words
  • Declaratives
  • Indicatives

Q3. What division of a COBOL program would you put your name in, if you wanted other programmers to see who created it?

  • Identification Division
  • Procedure Division
  • Credit Division
  • Environment Division

Quiz 04: COBOL Divisions

Q1. Which COBOL construct encapsulates the highest number of other constructs?

  • Statements
  • Divisions
  • Paragraphs
  • Albums

Q2. A period at the end of COBOL statements is a ___________ scope terminator

  • Implicit
  • Explicit
  • Implied
  • Dependent

Q3. The division where you might perform math or interact with a user is known as the

  • Activation Division
  • Run Division
  • Procedure Division
  • Dynamic Division

Quiz 05: COBOL Variables

Q1. Which of the following is NOT a valid Data Name?

  • REPORT VALUES
  • REPORT_VALUES
  • REPORT_FOR_DIVISION_NO_12345
  • REPORT_FOR_DIVISION_#12345

Q2. What can we tell about a variable defined as a PIC 9(5)?

  • It is numeric and a length of 9
  • It  is numeric and a length of 5
  • It is numeric with a range of 5-9 digits
  • There are 4 other PIC 9’s in this data definition clause

Q3. In a PIC clause, a V represents what?

  • A Variable
  • A Version Number
  • Underline
  • Decimal Position

Quiz 06 : Week 1 graded quiz

Q1. We define the IP address and login information for the system we are attempting to log in to by creating a _____________.

  • Host Registry
  • Connection Profile
  • Linkage Profile
  • Command Broker

Q2. The URL and port we enter to specify a connectto the mainframe system is also known, in this case, as the __________ URL.

  • z/OSMF
  • ZD&T
  • Zowe
  • Z99998

Q3. After successfully creating a connection to a working system using VS Code and the Zowe Explorer Plugin, three new menu sections appear, consisting of:

  • Favorites, Data Sets, Jobs
  • Jobs, Unix System Services, Code
  • Data Sets, Unix System Services, Jobs
  • Unix System Service, z/OS Facilities, Job Output

Q4. To specify the data sets you want to see for your particular user, you create or select a___________

  • Scope
  • Switch
  • View
  • Filter

Q5. To run COBOL code on z/OS, we right-click and select “Submit Job” on what file?

  • Parameters
  • JCL
  • COBOL
  • JSON

Q6. What does a COBOL Statement usually begin with?

  • Sentences
  • Parenthesis
  • Reserved words
  • Filler

Q7. What division acts as a link between your program and the system it’s running on?

  • Data Division
  • Identification Division
  • Procedure Division
  • Environment Division

Week 02: COBOL Programming with VSCode Coursera Quiz Answers

Quiz 01: Data Division

Q1. MOVE and COMPUTE are used to do what?

  • Upgrade the version of COBOL
  • De-fragment internal storage
  • Shift data into new registers
  • Alter the value of variables

Q2. When you’re running COBOL on a mainframe, you run it by submitting the ________

  • EBCDIC Character Set
  • Punch Card Emulation Deck
  • JCL
  • Procedure Division

Q3. MOVE and COMPUTE go into what division?

  • Procedure
  • Data
  • Intrinsic
  • Environment

Quiz 02: File Handling

Q1. What clause is used to describe a data set source file?

  • Link
  • Pointer
  • Load
  • Assign

Q2. The SELECT and ASSIGN clauses go into which division?

  • Data
  • Environment
  • Processing
  • Assignment

Q3. In the JCL, what does the DD statement help define?

  • The actual data set on the disk
  • The Data Driver used to access our modules
  • The FILE_RECORD limit has been reached
  • The record we just loaded is equal to the previous record

Quiz 03: Procedure Division

Q1. What construct do we use to perform an action one or multiple times in COBOL?

  • DO
  • ITERATE
  • PERFORM
  • SUB-ACT

Q2. What line of code is used to cease use of the ACCT-REC file after we’re done with it?

  • DISCONNECT
  • READ-DONE
  • DEALLOC
  • CLOSE

Q3. In the example, why would LASTREC = Y?

  • We processed the last record
  • The next read will hit the last record
  • The FILE_RECORD limit has been reached
  • The record we just loaded is equal to the previous record

Quiz 04: Program Structure

Q1. A loop in program structure is sometimes referred to as a

  • Campaign
  • Policy Execution
  • Inline Perform
  • Out-of-Line Perform

Q2. What style of programming creates objects, methods, and instances?

  • Fully Recursive Programming
  • Object Oriented Programming
  • Top-to-Bottom Programming
  • Abstract Cellular Programming

Q3. How is using PERFORM different from using a GO TO?

  • PERFORM uses call-by-reference variables
  • GO TO runs entirely in-memory
  • PERFORM returns to where it was called from after an implicit or explicit termination
  • PERFORM can only perform diagonal jumps

Quiz 05: Paragraphs

Q1. In COBOL, which section of columns musta paragraph start in?

  • 0-5
  • 1-22
  • 8-11
  • 22-30

Q2. Where should a paragraph be written in order for it to be called?

  • Immediately after the line of code calling it
  • Anywhere in the Procedure Division
  • It must be written in full above where it gets called
  • In the Paragraphs Division

Q3. If we wanted to PERFORM a series of paragraphs, in order, and then return after performing a specific paragraph, we could use what?

  • PERFORM BRANCH
  • PERFORM MISSION
  • PERFORM PARALLEL
  • PERFORM THRU

Quiz 06: Program Linkage

Q1. A COBOL program can use code from another COBOL program using what keyword?

  • CALL
  • HEAP
  • EXTEND
  • PEEK

Q2. Variables that will get used by the program being called go into what section?

  • EXTEND SECTION
  • VIRTUAL SECTION
  • LINKAGE SECTION
  • TEAM SECTION

Q3. To specify those variables when we invoke the called program’s logic, we use what phrase?

  • USING
  • WITH
  • WITHIN
  • INTO

Quiz 07: File Output and Reports

Q1. The File Descriptor (FD) goes within what paragraph of the Input-Output Section?

  • FILE-CONTROL
  • INPUT DECLARATION
  • FILE-HANDLER
  • IO-DIRECTOR

Q2. The COBOL reserved word used to allocate memory space with pre-defined content is:

  • PADDING
  • EXTRA
  • STUFFING
  • FILLER

Q3. We can define how the fields of data are structured by defining the ________

  • Data Capsule
  • Data Name Layout
  • Field Allocation Table
  • Sub-Field Structure

Quiz 08: Week 2 graded quiz

Q1. What change is required to make the output of the report in CBL0005 formatted as a dollar value?

  • Format it with dollar signs instead of Z’s
  • Format it with D’s instead of Z’s
  • Declare the variable using the WITH_DOLLARS Intrinsic Function
  • Using the PIC($$$) clause

Q2. For the PAYROL00 job output, where do we find details for the Execution (as opposed to the Compile details)?

  • PAYROLL:JESJCL
  • PAYROLL:SYSOUT
  • PAYROLL:JESYSMSG

Q3. What was the resolution for the ABENDU4038 error in CBL0003 where the program was unable to open or close the ACCTREC file name?

  • The permissions on the ACCTREC file were incorrect and needed to be updated
  • The amount of records in the data set was inconsistent between JCL and COBOL code
  • It was specified as INPUT when it should have been OUTPUT
  • ACCTREC was spelled wrong in the JCL and needed to be corrected

Q4. In which divisions do you describe the inputs and outputs, in file handling, that will be used in the Procedure Division?

  • Identification and Environment Divisions
  • Environment and Data Divisions
  • Procedure and Data Divisions
  • Identification and Data Divisions

Q5. What does the SELECT ASSIGN clause do in this snippet of code:

U0 ZQa lRtaPmUGv5abWeA 5b63c6aece7f546ee502282e0737adf4 Annotation 2020 05 12 132643

  • Selecting the external file name, PRINT-LINE, and assigning it to the internal file/data set, PRTLINE.
  • Selecting the internal file name, PRINT-LINE, and assigning it to the internal file/data set, PRTLINE.
  • Selecting the internal file name, PRINT-LINE, and assigning it to the external file/data set, PRTLINE.
  • Selecting the external file name, PRINT-LINE, and assigning it to the external file/data set, PRTLINE.

Q6. What is a block?

  • A section of code in the source code
  • A group of records to be loaded into the program
  • A COBOL reserved word
  • A COBOL data type

Week 03: COBOL Programming with VSCode Coursera Quiz Answers

Quiz 01: Conditional Expressions

Q1. Which of the following is NOT a type of COBOL conditional expression?

  • General relation condition
  • Class conditions
  • Sign conditions
  • Sorting conditions

Q2. A Conditional Name needs to be declared with a _____-level number

  • 0
  • 50
  • 88
  • 100

Q3. What type of statement is best suited for handling more than two paths of code logic, like a menu with sub-menu items?

  • EVALUATE
  • ALL-AT-ONCE
  • SPECIFY
  • IMPLEMENT

Quiz 02: Arithmetic Expressions

Q1. What characters do we use to indicate an exponential operation?

  • ^^
  • @@
  • **
  • /*

Q2. What can an arithmetic expression NOT start with?

  • Left Parenthesis
  • Unary Operator
  • Operand
  • /

Q3. If we say COMPUTE X Y Z = 2 + 2 + 6, what will happen?

  • X Y and Z will be set to 10
  • X will be 2, Y will be 2, Z will be 6
  • X Y and Z will merge into a new variable
  • The operation will fail because X Y and Z are letters, and the arithmetic expression is numerical

Quiz 03: Data Types

Q1. COMP-1 and COMP-2 are both what type of numerical representation?

  • Floating Point
  • Hexadecimal
  • Branching Digit
  • Virtual Decimal

Q2. COMP-3 uses what type of numerical representation?

  • BCD: BInary Coded Decimal
  • BCD: Branch Coded Decimal
  • BDD: Binary Digit Descriptor
  • BDT: Bit Descriptor Technology

Q3. When it comes to character representation, you can use ASCII or _______

  • UTILICODE
  • CHARBYTE
  • EBCDIC
  • PEMDAS

Quiz 04: Intrinsic Functions

Q1. The most recent version of COBOL (as of 2020) has how many Intrinsic Functions?

  • 50
  • 70
  • 250
  • 500

Q2. The format of an Intrinsic Function is

  • RUN FUNCTION function name(arguments)
  • Function name(arguments) EXECUTE
  • FUNCTION function name (arguments)
  • EXECUTE function name WITH (arguments)

Q3. You can turn a YYYYMMDD-formatted date into a count of days since January 1st1601 using the _____________ Intrinsic Function.

  • NUMERIC-DATE
  • DAY-COUNT
  • DATE-TABULATE
  • INTEGER-OF-DATE

Quiz 05: Week 3 graded quiz

Q1. What is the new feature added into the CBL0006 program that was not in CBL0005?

  • It adds an Average of all account balances
  • It adds a count of the number of people from the state of Virginia
  • There is now the ability to sort the people by name and state
  • It adds an additional field to the data for Age When Elected

Q2. In CBL0008, TLIMIT and TBALANCE get printed in what section of the report?

  • HEADER-3
  • HEADER-4
  • FOOTER-1
  • TRAILER-2

Q3. Why didn’t CBL0010 compile correctly the first time?

  • A misplaced comma in the JCL
  • It needs to be in COMPATIBILITY Mode, not EXTENDED Mode
  • A mismatch between the record lengths in the file and what the COBOL expects
  • The same variable is declared twice, which cannot happen

Q4. If Item-1 has a value of “Hello World!”, what will the value ofItem-1 be after executing the following code: Display Function Upper-Case(Item-1) ?

  • “Hello World!” (Sentence-Case)
  • “HELLO WORLD!” (Upper-Case)
  • “hello world!” (Lower-Case)
  • “hELLO wORLD!”

Q5. If we were coding an Inline Perform statement, where the looped portion of code simply DISPLAY-ed the value of COUNTER, which PERFORM statement could be used to ensure we output exactly 100 through 200?

  • PERFORM VARYING COUNTER FROM 100 BY 1 UNTIL COUNTER EQUAL 201
  • PERFORM VARYING COUNTER FROM 99 BY 1 UNTIL COUNTER EQUAL 201
  • PERFORM VARYING COUNTER FROM 99 BY 1 UNTIL COUNTER EQUAL 199
  • PERFORM WHILE COUNTER <= 200 DO COUNTER + 1

Q6. In the arithmetic expression COMPUTE X = 1 + 2 (15 / 3) * 60 -8, what part of the expression gets solved first when processed in COBOL?

  • 1 + 2
  • 15 / 3
  • 60 – 8
  • 3 * 52

Q7. If X is 5 and Y is 8, which of the following expressions would evaluate as FALSE?

  • IF X < Y
  • IF X NOT < Y
  • IF Y NOT < X
  • IF Y >= 8
Conclusion:

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!