0

programming languages Online Quiz - 256

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

How will you define the list of variables to be printed in the PRINT procedure?

  1. Weight statement

  2. Var statement

  3. Class statement

  4. By statement


Correct Option: B

You have to sort the dataset Temp by the values of salary in descending order. SORT procedure is given below. Find out the missing statement? Data temp; Infile datalines; Input empname $ salary; Datalines; AAA 25000 BBB 45000 CCC 36000 DDD 47000 ; Proc sort data=temp; <<<<<<>>>>>>>>>; Run;

  1. by descending salary

  2. by salary descending

  3. by salary ascending

  4. by salary


Correct Option: A

How can you assign a value from a datastep to a macro variable?

  1. Using Symget function

  2. Using Symput function

  3. Using Assign function

  4. Using Sysfunc function


Correct Option: B

Can we use title statement inside Proc SQL?

  1. True

  2. False


Correct Option: B

What is the value of z? z=weekday(today()); Today being Wednesday, 30 September 2009

  1. 2

  2. 3

  3. 5

  4. 4


Correct Option: D

What are the different classes of tokens available in SAS?

  1. Literals, Numbers, Strings and Symbols

  2. Literals, Numbers, Names and Special Characters

  3. Literals, Characters, Special Characters and Symbols

  4. Characters and Numbers only


Correct Option: B
  1. Used to execute SAS Functions

  2. Used to execute SAS Statements

  3. Used to pass parameters to a macro function

  4. All of the above


Correct Option: A

In Proc SQL, Index can be created on tables and views. State whether the statement is true or false. Also classify the index types in Proc SQL?

  1. True, Simple and Complex

  2. False, Simple and Composite

  3. True, Simple and Composite

  4. False, Simple and Complex


Correct Option: B

What is the value stored in the variable x? Data test; name = ’TATA CONSULTANCY SERVICES’; b = ’C’; x = INDEX (name, b); Run;

  1. 2

  2. 23

  3. 6

  4. 5


Correct Option: C
  1. Includes external files

  2. Includes SAS datasets

  3. Includes variables from other datasets

  4. All of the above


Correct Option: A

State which of the following statement(s) are correct regarding Proc SQL?

  1. In simple index, the index name must be same as the column name.

  2. The values must be in sorted form

  3. Indexing helps to retrieve the data faster

  4. All of the above


Correct Option: A,C

What will be the result of compiling and running the following code? (Assume that assertions are enabled at compile time as well as at runtime.) class Test { String f(int i) { switch (i) { case 0: return "A"; case 1: return "B"; case 2: return "C"; default: assert false; } } public static void main(String[] args) { Test t = new Test(); for (int i = 0; i < 4; i++) { System.out.print(t.f(i)); } } }

  1. Prints "ABC" and throws AssertionError

  2. Prints "ABC" and throws AssertionException

  3. Prints "ABC" and exits without any error

  4. Compilation error

  5. Run time exception

  6. None of the above


Correct Option: D
  1. . private or nothing (default) on line 3. Nothing (default) or protected or public on line 8.

  2. public or protected on line 3. private or nothing (default) on line 8.

  3. Nothing (default) or protected or public on line 3. private or nothing (default) on line 8.

  4. public on line 3 and private on line8.


Correct Option: A
  1. Throw AssertionError

  2. Throw IllegalStateException

  3. Throw IllegalArgumentException

  4. Throw InvalidArgumentException


Correct Option: C

What will be the result of compiling and running the following code? public class MyThread extends Thread { public static void main(String[] args) { new MyThread().start(); } }

  1. Compile-time error

  2. Runtime error

  3. No output

  4. None of these


Correct Option: C

Given the following two classes, which statement is true? ---------- class-1 ---------- package pack; public class Parent { protected void test() { System.out.println("Test"); } } ---------- class-2 ---------- 1. package mypack; 2. import pack.*; 3. class ParentTest extends Parent{ 4. public static void main(String[] args){ 5. new ParentTest().test(); 6. new Parent().test(); 7. } 8. }

  1. The code will compile and run only if line 5 is removed.

  2. The code will compile and run only if line 6 is removed

  3. The code compiles and runs, printing "Test" twice

  4. The code compiles but throws an exception at runtime


Correct Option: B
- Hide questions