0
Alien head

programming languages Online Quiz - 164

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

Assume you create a Student class with the variables name, ID, and course. You then create a method called gradeStudent. If you create a subclass of the Student class called GraduateStudent, what does it inherit?

  1. An instance of the Student class

  2. The course variable

  3. The gradeStudent method

  4. The ID variable

  5. The name variable


Correct Option: B,C,D,E

When do you need to use an array?

  1. To create a mutable string

  2. To store a single character

  3. To store multiple items of the same type

  4. none


Correct Option: C

What is the correct way to declare and initialize a string object, "start", whose value - "Welcome to Java Programming" - can be shared?

  1. String start = new String("Welcome to Java Programming");

  2. String start[] = "Welcome to Java Programming";

  3. String start = "Welcome to Java Programming";

  4. none


Correct Option: C

Identify the type of the following comment: /* this method prints out all *the employee's information */ Choose an option.

  1. Doc comment

  2. In-line comment

  3. Multi-line comment

  4. none


Correct Option: C

Which Java keywords do you use in conditional statements to control program flow? Choose more than one option.

  1. catch

  2. else

  3. finally

  4. if


Correct Option: B,D

You are required to represent the employees at a company in Java code. The employees are categorized according to their position and salary. You also need to be able to change the state of an employee due to a promotion. How could you represent this?

  1. Create a Salary object

  2. Declare an Employee class

  3. Declare an instance of the Employee class called Promotion

  4. Declare a promotion method that changes the value of the position variable

  5. Define variables for position and salary


Correct Option: B,D

Assume you have created a piece of Java source code and compiled it successfully. How does the Java platform execute the code?

  1. The compiler interprets the bytecode in the Java class file

  2. The Java Virtual Machine (JVM) interprets the bytecode in the Java class file

  3. The JVM interprets the native machine code

  4. The JVM translates compiled bytecode to machine code


Correct Option: B,D

Which lexical elements do you use to start and end a comment that you wish to include as part of documentation? Choose more than one option.

  1. //

  2. /*

  3. /**

  4. */


Correct Option: C,D

Which range of values is valid for all integral types, where n is the number of bits?

  1. 2^(n-1) to 2^(n+1)+1

  2. -2^(n-1) to 2^(n-1)-1

  3. -2^(n-1) to 2^(n-1)+1

  4. -2^(n-1) to 2^(n+1)-1


Correct Option: B

Suppose you want to declare an array of the first five letters of the alphabet. How do you declare and initialize the array?

  1. char[] alpha = {'A', 'B', 'C', 'D', 'E'};

  2. char[] alpha = {"A", "B", "C", "D", "E"};

  3. char[] alpha = new char('A', 'B', 'C', 'D', 'E');

  4. char[][] alpha = {{'A', 'B', 'C', 'D', 'E'}};


Correct Option: A

Suppose you are using a Windows operating system and you wish to run an application. The application class is named App1 and is contained within the samples.java package. Choose the command that will run the application.

  1. java App1.samples.java

  2. java samples.java.App1

  3. javac samples.java.App1

  4. javac App1.samples.java


Correct Option: B

Suppose you want to define a class named Application1. This is the only class in the application. Which code completes the declaration of the class?

  1. class Application1

  2. public class Application1

  3. public static void Application1

  4. static Application1


Correct Option: B

A variable defined in a report is available

  1. For one tab

  2. For all tabs of the Report

  3. Depends how it is defined as global or Private

  4. None of the above


Correct Option: B

Which of the following code can obtain a 95 percent confidence interval around the mean total KwH consumption and around the mean billed revenue, along with the mean and median from the dataset ORGANIZATION.

  1. PROC MEANS DATA= ORGANIZATION MEDIAN MEAN CLM MAXDEC=0; Label TOTREV = 'Total Billed Revenue' TOTKWH = 'Total KwH Consumption'; VAR TOTREV TOTKWH; run;

  2. PROC MEANS DATA= ORGANIZATION MEDIAN MEAN UCLM ; Label TOTREV = 'Total Billed Revenue' TOTKWH = 'Total KwH Consumption'; VAR TOTREV TOTKWH; run;

  3. PROC MEANS DATA= ORGANIZATION MEDIAN MEAN LCLM Label TOTREV = 'Total Billed Revenue' TOTKWH = 'Total KwH Consumption'; VAR TOTREV TOTKWH; run;

  4. PROC MEANS DATA= ORGANIZATION MEDIAN SUM CLM MAXDEC=0; Label TOTREV = 'Total Billed Revenue' TOTKWH = 'Total KwH Consumption'; VAR TOTREV TOTKWH; run;


Correct Option: A

data test; input region $ totrev tothrs totkwh; datalines; north 3 45 55 north 345 64 64 south 235 34 345 east 23 346 576 south 23 5 4 ; run; PROC MEANS DATA=TEST1 NOPRINT; VAR TOTREV TOTKWH TOTHRS; OUTPUT OUT=TEST2 sum(TOTREV TOTKWH) = mean(TOTREV) = median(TOTHRS) = / AUTONAME; run; What are the column names of the dataset TEST2?

  1. TYPE , FREQ , totrev_Sum , totkwh_Sum , totrev_Mean , tothrs_Median

  2. TYPE , FREQ , total revenue sum , total kwh Sum , total revenue Mean , total hrs Median

  3. TYPE , FREQ , totrev , totkwh , tothrs

  4. totrev_Sum , totkwh_Sum , totrev_Mean , tothrs_Median


Correct Option: A

What does the following code do? PROC MEANS DATA= ORGANIZATION(WHERE=(REGION IN('WESTERN','SOUTHERN') and SUBSTR(RATE_SCHEDULE,1,2) = 'E1')) MAXDEC = 0 MEAN SUM NONOBS; VAR TOTREV; CLASS REGION RATE_SCHEDULE; run;

  1. Calculate the mean total revenue classified by REGION and RATE_SCHEDULE, but only for the WESTERN and SOUTHERN REGIONS, and only for those two regions whose values of RATE_SCHEDULE start with the string “E1.”

  2. Displays the number of observations(records), mean and total revenue classified by REGION and RATE_SCHEDULE, for the WESTERN and SOUTHERN REGIONS, and only for those two regions whose values of RATE_SCHEDULE start with the string “E1.”

  3. Calculate the mean total revenue classified by REGION and RATE_SCHEDULE, for all the regions except the WESTERN and SOUTHERN REGIONS, and only for those two regions whose values of RATE_SCHEDULE start with the string “E1.”

  4. Displays the Rate Schedule of the WESTERN and SOUTHERN REGIONS where variable TOTREV is an integer.


Correct Option: A

How to obtain only the MEAN and SUM of TOTREV classified by REGION in the ORGANIZATION data set.

  1. PROC MEANS DATA= ORGANIZATION ; CLASS REGION; VAR TOTREV ; run;

  2. PROC MEANS DATA= ORGANIZATION SUM MEAN MAXDEC=0 ; CLASS REGION; VAR TOTREV ; run;

  3. PROC MEANS DATA= ORGANIZATION SUM MEAN MAXDEC=0 ; BY REGION; CLASS TOTREV ; run;

  4. PROC MEANS DATA= ORGANIZATION SUM MEAN MAXDEC=0 ; CLASS North_Region; VAR TOTREV ; run;


Correct Option: B

There are 45 records having the variable REGION value as missing.How to display the SUM and MEAN of TOTREV for these records?

  1. PROC MEANS DATA= ORGANIZATION SUM MEAN ; CLASS REGION; VAR TOTREV / MISSING; run;

  2. PROC MEANS DATA= ORGANIZATION SUM MEAN MAXDEC=0 NMISS; CLASS REGION; VAR TOTREV; run;

  3. PROC MEANS DATA= ORGANIZATION SUM MEAN MAXDEC=0 if not MISSING; CLASS REGION; VAR TOTREV; run;

  4. PROC MEANS DATA= ORGANIZATION SUM MEAN MAXDEC=0 MISSING; CLASS REGION; VAR TOTREV; run;


Correct Option: D

Which of the following code gives the output : The MEANS Procedure Analysis Variable : totrev Mean Sum 753.82 12349156.38

  1. PROC MEANS DATA=ORGANIZATION MEAN SUM MAXDEC=2; VAR TOTREV; run;

  2. PROC MEANS DATA=ORGANIZATION MAXDEC=2; VAR TOTREV; run;

  3. PROC MEANS DATA=ORGANIZATION MEAN SUM MAXDEC=2; run;

  4. PROC MEANS DATA=ORGANIZATION SUM ; VAR TOTREV; run;


Correct Option: A

While using CLASS and BY Statements in PROC MEANS one should keep in mind :

  1. Use the CLASS Statement when number of observation >10000

  2. Use the By Statement when number of observation <1000

  3. Using the BY Statement requires that the input data set be sorted by the values of the classification variables

  4. Using the CLASS Statement requires that the input data set be sorted by the values of the classification variables


Correct Option: C
+ View questions