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.
Questions
Which of the following are legal array declarations.
- int i[][];
- int i[5][5];
- int []i[];
- int[][] a;
The number of characters in an object of a class String is given by?
- The member variable called length
- The method length() returns the number of characters.
- The member variable called size
- The method size() returns the number of characters.
How many comparisons can a single COBOL if statement make?
- COBOL if statements are not used to compare variable values
- 1
- 2
- 3
Which of the following errors are possible within a COBOL IF statement?
- Infinite loop
- logical error
- runtime error
- All of the above
The COBOL perform loop is the equivalent of which of the following structures found in other languages, such as Java or C++ ?
- For Loop
- Do-While Loop
- Nested Loop
- While Loop
Which is the correct ASCII collating sequence?
- spaces, special characters, 0-9, A-Z, a-z
- spaces, a-z, A-Z, 0-9, special characters
- a-z, A-Z, 0-9, spaces, special characters
- 0-9, special characters, spaces, a-z, A-Z
You store it as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?
- Pic Y(4)M(2)D(2)
- Pic date(yyyymmdd)
- Pic date(8)
- Pic X(8)
User defined names must follow which one of the following rules?
- Multiple word names must be separated with an underscore
- Names must be 10 or less characters
- Names must contain at least 1 alpha character in any position
- Names must be lower case
Cobol paragraphs contain sentences. A sentence must end in a period and can contain multiple statements.
- TRUE
- FALSE
- Cant say
- still thinking
Sentences and statements must start on a new line.
- TRUE
- FALSE
- Cant say
- None of the above
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?
- 55
- 66
- 77
- 88
If we are limited to 5 bytes of storage, is there be a way to store a complete 8 digit date?
- YES
- NO
- Cant say
- None of the above
Can Abstarct class have a constructor?
- True
- False
lambda operator(=>) is a C# 2008 feature. Where is lambda operator mainly used?
- Database Operations
- Delegate Operations
- File Handling Operations
- Memory Stream Operations
Give Some Examples of Generic Classes?
- List,HashSet
- Queue
- Stack
- LinkedList
- All the above
Which two DataAdapter events fire for each row updated against a datasource?
- RowUpdating, AfterUpdate
- BeforeUpdate, RowUpdating
- RowUpdating, RowUpdated
- BeforeUpdate, AfterUpdate
- BeforeUpdate, RowUpdated
What is the size for double datatype in c#?
- 1 byte
- 2 byte
- 4 byte
- 8 byte
- 16 byte
To quit a c# application the following should be used?
- Application.Exit();
- System.Environment.Exit(0)
- System.Environment.Exit(1)
- All the above
Which of these string definitions will prevent escaping on backslashes in c#?
- String s=#”\teststring”;
- String s=”’\n teststring”;
- String s=@”\teststring”;
- none of above
Which of the following statements correctly declares a 2 dimensional array in c#?
- int[,] myarray;
- int[][] myarray
- int[2] myarray
- none of above