0

programming languages Online Quiz - 210

Description: programming languages Online Quiz - 210
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

It is better to buffer a table when

  1. When a table is read infrequently

  2. When a table is linked to check tables

  3. When a table is read frequently and the data seldom changes

  4. When a single record is to be picked up


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of table buffering.

Table buffering is a technique used in computer systems to improve performance when accessing data from a database table. It involves storing a copy of the table data in memory, which allows faster access to the data when it is needed. The copy in memory is called a buffer.

Let's go through each option to understand why it is correct or incorrect:

Option A) When a table is read infrequently - This option is incorrect. Buffering a table is typically not necessary when the table is read infrequently because the overhead of maintaining the buffer outweighs the performance benefits.

Option B) When a table is linked to check tables - This option is incorrect. Buffering a table is not directly related to linking it to check tables. The need for buffering depends on the frequency of reading the table and the data change frequency.

Option C) When a table is read frequently and the data seldom changes - This option is correct. Buffering a table is beneficial when the table is read frequently because it reduces the need to access the disk for each read operation. It is also useful when the data seldom changes because the buffer can be updated less frequently.

Option D) When a single record is to be picked up - This option is incorrect. Buffering a table is not specifically related to picking up a single record. It is more applicable when multiple records or a large amount of data needs to be accessed frequently.

Therefore, the correct answer is Option C) When a table is read frequently and the data seldom changes. This option is correct because buffering a table in such cases can significantly improve performance by reducing disk access and utilizing the buffer for faster data retrieval.

Data element is an example of:

  1. Physical Definition

  2. Business Object

  3. Semantic Domain

  4. Technical Domain


Correct Option: C

In Inner and outter join

  1. Buffers are always used

  2. Choice of buffer can be made to use

  3. Buffers are always bypassed

  4. None of above


Correct Option: C

What is the TCODE to create a Table?

  1. SE38

  2. SE11

  3. SE93

  4. SM30


Correct Option: B

What is the difference between Synchronous and Asynchronous updates?

  1. In synchronous processing, the program waits: control returns to the program only when the task has been completed

  2. In asynchronous processing, the program does not wait: the system returns control after merely logging the request for execution

  3. In asynchronous processing, the program waits: control returns to the program only when the task has been completed

  4. In synchronous processing, the program does not wait: the system returns control after merely logging the request for execution


Correct Option: A,B

Which of the following lines will compile without warning or error

  1. float f=1.3;

  2. int i=10;

  3. char c="a";

  4. byte b=257;

  5. boolean b=null;


Correct Option: B

A byte can be of what size

  1. -128 to 127

  2. (-2 power 8 )-1 to 2 power 8

  3. -255 to 256

  4. depends on the particular implementation of the Java Virtual machine


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of a byte and its size.

A byte is a unit of digital information that consists of 8 bits. Each bit can be either a 0 or a 1, representing a binary value. With 8 bits, a byte can represent 2^8 (256) different values.

Option A) -128 to 127 - This option is correct because a byte can represent values from -128 to 127. In 2's complement representation, the leftmost bit is used as the sign bit, where 0 represents a positive value and 1 represents a negative value. This allows for a range of -2^7 (-128) to 2^7-1 (127).

Option B) (-2^8)-1 to 2^8 - This option is incorrect because it states a range from -255 to 256, which exceeds the valid range for a byte. The valid range for a byte is from -128 to 127.

Option C) -255 to 256 - This option is incorrect for the same reason as option B. The valid range for a byte is from -128 to 127.

Option D) depends on the particular implementation of the Java Virtual machine - This option is incorrect because the size of a byte is standardized and consistent across different implementations of the Java Virtual Machine. The range of -128 to 127 is universally accepted for a byte.

The correct answer is A) -128 to 127. This option is correct because it accurately represents the valid range for a byte.

Which of the following are keywords or reserved words in Java?

  1. if

  2. then

  3. goto

  4. while


Correct Option: B

What will happen if you try to compile and run the following code? public class Q { public static void main(String argv[]){ int anar[]=new int[5]; System.out.println(anar[0]); } }

  1. Error: anar is referenced before it is initialized

  2. null

  3. 0

  4. 5


Correct Option: C

Which of the following most closely describes a bitset collection?

  1. A class that contains groups of unique sequences of bits

  2. A method for flipping individual bits in instance of a primitive type

  3. An array of boolean primitives that indicate zeros or ones

  4. A collection for storing bits as on-off information, like a vector of bits


Correct Option: D

Is C++ case sensitive?

  1. No

  2. Case sensitivity is compiler-determined

  3. Yes

  4. Don't Know


Correct Option: C

What does the code "cout<

  1. 0

  2. 1

  3. Compiler error: Lvalue required

  4. Don't Know


Correct Option: B

If the program completes executing successfully, what value should the function main() return?

  1. 0

  2. 1

  3. void

  4. Don't Know


Correct Option: A

AI Explanation

To answer this question, we need to understand the concept of the return value of the main() function in a program.

In most programming languages, the main() function is the starting point of a program and is required to have a return type. The return type of the main() function indicates the status of the program execution.

Option A) 0 - This option is correct. In most programming languages, including C and C++, the main() function should return an integer value. By convention, returning 0 from the main() function indicates that the program executed successfully without any errors.

Option B) 1 - This option is incorrect. Returning 1 from the main() function usually indicates that the program encountered an error or some exceptional condition during execution.

Option C) void - This option is incorrect. The return type of the main() function cannot be void in most programming languages. The main() function must have a return type of int.

Option D) Don't Know - This option is incorrect. We do know the value that the function main() should return if the program completes executing successfully.

Therefore, the correct answer is option A) 0. This option is correct because returning 0 from the main() function indicates that the program executed successfully without any errors.

In which header file is isalpha() declared?

  1. conio.h

  2. stdio.h

  3. ctype.h

  4. stdlib.h


Correct Option: C

What will happen when the following code is run: int x; while(x<100) { cout<

  1. The computer will output "0123...99"

  2. The computer will output "0123...100"

  3. The output is undefined

  4. Don't know


Correct Option: C

AI Explanation

To answer this question, you need to understand how the code snippet works.

The code snippet initializes an integer variable x without assigning it a value. In C++, uninitialized variables have an undefined value. Therefore, the initial value of x is unknown.

Next, the code enters a while loop that continues as long as x is less than 100. Inside the loop, the code prints the value of x using `cout<

What does the following code output? void afunction(int *x) { x=new int; *x=12; } int main() { int v=10; afunction(&v); cout<

  1. Outputs 12

  2. Outputs 10

  3. Outputs the address of v

  4. Compile error


Correct Option: B

What is the outcome of the line of code "cout<

  1. 16

  2. 17

  3. 16.5

  4. Error


Correct Option: A

What value will "strcmp("Astring", "Astring");" return?

  1. A positive value

  2. A negative value

  3. Zero

  4. Compile Error


Correct Option: C

AI Explanation

To answer this question, you need to understand the function strcmp() in C.

The strcmp() function is used to compare two strings in C. It returns an integer value that indicates the relationship between the two strings.

In this case, the strcmp("Astring", "Astring") compares the string "Astring" with itself. Since the two strings are identical, the strcmp() function will return 0.

Therefore, the correct answer is C) Zero.

Evaluate !(1&&1||1&&0)

  1. Error

  2. True

  3. False

  4. Can't Say


Correct Option: C

What header file is needed for the function exit()?

  1. stdlib.h

  2. conio.h

  3. dos.h

  4. ctype.h


Correct Option: A

AI Explanation

To answer this question, you need to understand the purpose of the exit() function and which header file it belongs to.

The exit() function is used to terminate a program and return control to the operating system. It is defined in the stdlib.h header file, so the correct answer is option A) stdlib.h.

Let's go through each option to understand why it is correct or incorrect:

Option A) stdlib.h - This option is correct because the exit() function is defined in the stdlib.h header file. Option B) conio.h - This option is incorrect because the conio.h header file is used for console input/output functions and does not contain the exit() function. Option C) dos.h - This option is incorrect because the dos.h header file is used for accessing DOS-specific functions and does not contain the exit() function. Option D) ctype.h - This option is incorrect because the ctype.h header file is used for character handling functions and does not contain the exit() function.

The correct answer is option A) stdlib.h. This option is correct because the exit() function is defined in the stdlib.h header file.

- Hide questions