0
Alien head

programming languages Online Quiz - 125

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

package A; sub new { return bless {}, shift; } sub DESTROY { print ref(shift); } package B; use base 'A'; sub DESTROY { my $self = shift; print ref($self); bless $self, 'A'; } package main; my $obj = B->new();

  1. BA

  2. AB

  3. Compilation Error

  4. Null point reference error


Correct Option: A

$string = “\uhello world!”; print $string; $string = “\Uhello world!”; print $string;

  1. Hello world HELLO WORLD.

  2. Hello World HELLO WORLD.

  3. Hello world HELLO world.

  4. hello world HELLO WORLD.


Correct Option: A

$input = “abdce” =~ tr/abc/123 print $input;

  1. 123

  2. 123ce

  3. Cant modify constant item in translation

  4. 12d3e

  5. None of the above


Correct Option: C

To copy entire matched sequence

  1. $&

  2. $%

  3. $_

  4. [email protected]

  5. $^


Correct Option: A

/de{0,3}/ matches

  1. df

  2. def

  3. deef

  4. deeef

  5. all the above


Correct Option: E

You are creating a PROC SQL query that will list all employees who have spent (or overspent) their allotted 120 hours of vacation for the current year. The hours that each employee used are stored in the existing column Spent. Your query defines a new column, Balance, to calculate each employee’s balance of vacation hours. Which query will produce the report that you want?

  1. proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where balance <= 0;

  2. proc sql; select name, spent, 120-spent as Balance from Company.Absences where calculated balance <= 0;

  3. proc sql; select name, spent, 120-spent as Balance from Company.Absences where balance <= 0;

  4. proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where calculated balance <= 0;


Correct Option: B

Which of the following will cause PROC SQL to list rows that have no data in the Address column?

  1. WHERE address is missing

  2. WHERE address not exists

  3. WHERE address is null

  4. both a and c


Correct Option: D

Which statement about the use of table aliases is false?

  1. Table aliases must be used when referencing identical table names from different libraries.

  2. Table aliases can be referenced by using the keyword AS.

  3. Table aliases (or full table names) must be used when referencing a column name that is the same in two or more tables.

  4. Table aliases must be used when using summary functions.


Correct Option: D

Bonus dataset ID Bonus 123 5000 456 7000 744 3500 Salary Dataset ID Salary 123 70000 456 80000 978 55000 Given the PROC SQL query and tables shown below, which output is generated? proc sql; select s.*, bonus from bonus as b right join salary as s on b.id= s.id;

  1. ID Salary Bonus 123 70000 5000 456 80000 7000 978 55000 3500

  2. ID Salary Bonus 123 70000 5000 456 80000 7000 744 . 3500

  3. ID Salary Bonus 123 70000 5000 456 80000 7000 744 55000 3500

  4. ID Salary Bonus 123 70000 5000 456 80000 7000 978 55000 .


Correct Option: D

Which PROC SQL query will remove duplicate values of MemberType from the query output, so that only the unique values are listed?

  1. proc sql nodup; select membertype from sasuser.frequentflyers;

  2. proc sql; select distinct(membertype) as MemberType from sasuser.frequentflyers;

  3. proc sql; select unique membertype from sasuser.frequentflyers group by membertype;

  4. proc sql; select distinct membertype from sasuser.frequentflyers;


Correct Option: D

A PROC SQL inner join can combine

  1. a maximum of 2 tables or in-line views, but multiple joins can be chained together.

  2. a maximum of 32 tables or 2 in-line views.

  3. a maximum of 32 tables, which includes any tables referenced by an in-line view.

  4. a maximum of 2 tables and 32 columns.


Correct Option: C

In order for PROC SQL to perform an inner join,

  1. the tables being joined must contain the same number of columns.

  2. the tables must be sorted before they are joined

  3. the columns that are specified in a join condition in the WHERE clause must have the same data type.

  4. the columns that are specified in a join condition in the WHERE clause must have the same name.


Correct Option: C

Which statement about the following PROC SQL query is false? proc sql; validate select name label=’Country’, rate label=’Literacy Rate’ from world.literacy where ’Asia’ = (select continent from world.continents where literacy.name = continents.country) order by 2;

  1. The query syntax is not valid.

  2. The outer query must pass values to the subquery before the subquery can return values to the outer query.

  3. PROC SQL will not execute this query when it is submitted.

  4. After the query is submitted, the SAS log will indicate whether the query has valid syntax.


Correct Option: A

Consider this PROC SQL query: proc sql; select flightnumber, count(*) as Flights, avg(boarded) label="Average Boarded" format=3. from sasuser.internationalflights group by flightnumber having avg(boarded) > 150; The table Sasuser.Internationalflights contains 201 rows, 7 unique values of FlightNumber, 115 unique values of Boarded, and 4 different flight numbers that have an average value of Boarded that is greater than 150. How many rows of output will the query generate?

  1. 150

  2. 7

  3. 4

  4. 1


Correct Option: C

A Cartesian product is returned when

  1. join conditions are not specified in a PROC SQL join.

  2. join conditions are not specified in a PROC SQL set operatio

  3. more than two tables are specified in a PROC SQL join.

  4. the keyword ALL is used with the OUTER UNION operator.


Correct Option: A

In Java ,the statement Foo d = c; binds d to reference the same object as c, what will be equivalent statement in C++

  1. Foo d = c;

  2. Foo *d = c;

  3. Foo d; d=c;

  4. --


Correct Option: B

C++ is normally compiled directly to machine code which is then executed directly by the operating system

  1. True

  2. False


Correct Option: A

In C++, this pointer is used by the symbol___

  1. . (dot)

  2. ,

  3. ->

  4. >


Correct Option: C

In Java, to copy the contents of a to a new Foo object b

  1. Foo b = a;

  2. Foo b = a.clone();

  3. Foo b;b=a;

  4. -


Correct Option: B

C++ provides facility to specify that the compiler should match function calls with the correct definition at the run time. This process is called as

  1. Static binding

  2. Dynamic binding

  3. -

  4. --


Correct Option: B
+ View questions