0

programming languages Online Quiz - 150

Description: programming languages Online Quiz - 150
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. The code compiles and produces output: int version.

  2. Line 9 will not compile as there is no version of myMethod which takes a char as argument.

  3. An exception at line 9.

  4. Line 4 will not compile as void methods can't be overridden.


Correct Option: A

What is the result when you compile and run the following code? public class Test { public void method() { for(int i = 0; i < 3; i++) { System.out.print(i); } System.out.print(i); } }

  1. 0122

  2. 0123

  3. Compilation error

  4. None of these


Correct Option: C

What will be printed when you execute the following code? class X { Y b = new Y(); X() { System.out.print("X"); } } class Y { Y() { System.out.print("Y"); } } public class Z extends X { Y y = new Y(); Z() { System.out.print("Z"); } public static void main(String[] args) { new Z(); } }

  1. z

  2. yz

  3. xyz

  4. yxyz


Correct Option: C

Which program creates the output data set Work.Temp2? SAS Data Set Work.Temp Obs Month1 Month2 Month3 1 10 20 30 2 11 22 33 3 55 66 77 4 100 200 300 SAS Data Set Work.Temp2 Obs Month Quarter1 Quarter2 Quarter3 Quarter4 1 Month1 10 11 55 100 2 Month2 20 22 66 200 3 Month3 30 33 77 300

  1. proc transpose data=work.temp out=work.temp2 prefix=Quarter; run;

  2. proc transpose data=work.temp out=work.temp2 name=Month prefix=Quarter; run;

  3. proc transpose data=work.temp out=work.temp2 prefix=Month name=Quarter; run

  4. proc transpose data=work.temp out=work.temp2 prefix=Month index=Quarter; run;


Correct Option: B

Which of the following is true about Proc Freq?

  1. For one-way frequency tables, PROC FREQ can compute statistics to test for equal proportions, specified proportions, or the binomial proportion

  2. PROC FREQ automatically displays the output in a report and can also save the output in a SAS data set.

  3. To estimate the strength of an association, PROC FREQ computes measures of association that tend to be close to zero when there is no association and close to the maximum (or minimum) value when there is perfect association.

  4. Statement 1 & 2

  5. Statement 2 & 3

  6. All of the above


Correct Option: F

Frequency distributions work best with variables that contain

  1. Continuous values

  2. Numeric Values

  3. Categorical Values

  4. Unique Values


Correct Option: C

Several SAS procedures produce frequency counts; only PROC FREQ computes chi-square tests for one-way to n-way tables and measures of association and agreement for contingency tables

  1. True

  2. False


Correct Option: B

When processing a FREQ procedure it is possible to run out of memory due to the fact that this procedure stores all of the value combinations in memory during processing. In order to prevent this error, try using Proc SORT to sort the data by as many variables as you can and also include those sorted variables in a BY statement in your Proc FREQ procedure. True or False?

  1. True

  2. False


Correct Option: B

By default, PROC FREQ creates a table of frequencies and percentages for which data set variables?

  1. Character variables

  2. Numeric Variables

  3. Both Numeric & Character Variables.

  4. None : Variable names must be specified.


Correct Option: C

Data asthma; input city Asthma count; datalines; 1 1 35 1 0 65 2 1 40 2 0 60 3 1 25 3 0 75 ; run; proc format; value asth 0= 'No Asthma' 1= 'Asthma' ; run; Which of the following code produce the output : Asthma Frequency Percent ---------------------------------- Asthma 100 33.33 No Asthma 200 66.67

  1. proc freq data=asthma ; weight count; tables asthma / nocum; format asthma asth.; run;

  2. proc freq data=asthma order = formatted ; weight count; tables asthma / nocum; format asthma asth.; run;

  3. proc freq data=asthma order = formatted ; weight count; tables asthma ; format asthma asth.; run;

  4. proc freq data=asthma order = formatted ; tables asthma / nocum; format asthma asth.; run;


Correct Option: B

What will be printed? use strict; my @a = (1, 2, 3); my %b = (2 => undef); for my $val (@a) { last if $b{$val}; } print $val;

  1. undef

  2. 0

  3. 1

  4. 2

  5. the code is ill-formed


Correct Option: E

What will be the value of $str after execution of the following code? my $str = '112133'; $str =~ s/(.)\1/$1/g;

  1. 112133

  2. 1233

  3. 1213

  4. 12133


Correct Option: C

my $val = 'x'; print ref($val); What is the output?

  1. SCALAR

  2. empty value

  3. STRING

  4. not a reference


Correct Option: B
  1. holds the last pattern matched.

  2. holds the output field separator.

  3. identifies the current command line argument.

  4. none of the above is correct.


Correct Option: C
  1. Practical Extraction and Report Language

  2. Practice for Exclusive and Report Language

  3. Practical Extraction and Report Learning

  4. Practical Exclusive and Report Language


Correct Option: A
  1. is 10

  2. is true.

  3. cannot be determined from the information given.

  4. relies on which command line arguments were used.


Correct Option: C
  1. @a = split($str).

  2. @a = split(/\s/, $str).

  3. This task can be done in Perl but none of the above commands do it.

  4. @a = split(/./, $str).


Correct Option: C
- Hide questions