Multi-Language Programming Fundamentals Quiz

A mixed quiz covering basic concepts from C#, Java, and COBOL programming languages including arrays, data types, classes, and language-specific syntax.

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

Which of the following are legal array declarations.

  1. int i[][];
  2. int i[5][5];
  3. int []i[];
  4. int[][] a;
Question 2 Multiple Choice (Single Answer)

The number of characters in an object of a class String is given by?

  1. The member variable called length
  2. The method length() returns the number of characters.
  3. The member variable called size
  4. The method size() returns the number of characters.
Question 3 Multiple Choice (Single Answer)

How many comparisons can a single COBOL if statement make?

  1. COBOL if statements are not used to compare variable values
  2. 1
  3. 2
  4. 3
Question 4 Multiple Choice (Single Answer)

Which of the following errors are possible within a COBOL IF statement?

  1. Infinite loop
  2. logical error
  3. runtime error
  4. All of the above
Question 5 Multiple Choice (Single Answer)

The COBOL perform loop is the equivalent of which of the following structures found in other languages, such as Java or C++ ?

  1. For Loop
  2. Do-While Loop
  3. Nested Loop
  4. While Loop
Question 6 Multiple Choice (Single Answer)

Which is the correct ASCII collating sequence?

  1. spaces, special characters, 0-9, A-Z, a-z
  2. spaces, a-z, A-Z, 0-9, special characters
  3. a-z, A-Z, 0-9, spaces, special characters
  4. 0-9, special characters, spaces, a-z, A-Z
Question 7 Multiple Choice (Single Answer)

You store it as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?

  1. Pic Y(4)M(2)D(2)
  2. Pic date(yyyymmdd)
  3. Pic date(8)
  4. Pic X(8)
Question 8 Multiple Choice (Single Answer)

User defined names must follow which one of the following rules?

  1. Multiple word names must be separated with an underscore
  2. Names must be 10 or less characters
  3. Names must contain at least 1 alpha character in any position
  4. Names must be lower case
Question 9 Multiple Choice (Single Answer)

Cobol paragraphs contain sentences. A sentence must end in a period and can contain multiple statements.

  1. TRUE
  2. FALSE
  3. Cant say
  4. still thinking
Question 10 Multiple Choice (Single Answer)

Sentences and statements must start on a new line.

  1. TRUE
  2. FALSE
  3. Cant say
  4. None of the above
Question 11 Multiple Choice (Single Answer)

Condition names are names associated with a field that take on a true/false status depending on whether their value is equal to the field value. They are indicated by a level number of what?

  1. 55
  2. 66
  3. 77
  4. 88
Question 12 Multiple Choice (Single Answer)

If we are limited to 5 bytes of storage, is there be a way to store a complete 8 digit date?

  1. YES
  2. NO
  3. Cant say
  4. None of the above
Question 13 True/False

Can Abstarct class have a constructor?

  1. True
  2. False
Question 14 Multiple Choice (Single Answer)

lambda operator(=>) is a C# 2008 feature. Where is lambda operator mainly used?

  1. Database Operations
  2. Delegate Operations
  3. File Handling Operations
  4. Memory Stream Operations
Question 15 Multiple Choice (Single Answer)

Give Some Examples of Generic Classes?

  1. List,HashSet
  2. Queue
  3. Stack
  4. LinkedList
  5. All the above
Question 16 Multiple Choice (Single Answer)

Which two DataAdapter events fire for each row updated against a datasource?

  1. RowUpdating, AfterUpdate
  2. BeforeUpdate, RowUpdating
  3. RowUpdating, RowUpdated
  4. BeforeUpdate, AfterUpdate
  5. BeforeUpdate, RowUpdated
Question 17 Multiple Choice (Single Answer)

What is the size for double datatype in c#?

  1. 1 byte
  2. 2 byte
  3. 4 byte
  4. 8 byte
  5. 16 byte
Question 18 Multiple Choice (Single Answer)

To quit a c# application the following should be used?

  1. Application.Exit();
  2. System.Environment.Exit(0)
  3. System.Environment.Exit(1)
  4. All the above
Question 19 Multiple Choice (Single Answer)

Which of these string definitions will prevent escaping on backslashes in c#?

  1. String s=#”\teststring”;
  2. String s=”’\n teststring”;
  3. String s=@”\teststring”;
  4. none of above
Question 20 Multiple Choice (Single Answer)

Which of the following statements correctly declares a 2 dimensional array in c#?

  1. int[,] myarray;
  2. int[][] myarray
  3. int[2] myarray
  4. none of above