Please see description,

CMIS 141 7984 Introductory Programming (2158)

A non-local boolean variable is declared with the following Java code:

boolean myVar;

What is the value of myVar?
Question 1 options:

true

false

null

Unknown

None of the above
Question 2 (1 point)

Question 2 Unsaved
Select the valid Java comments from the statements below.
Question 2 options:

// Programming in Java

/* Programming in Java */

/** Programming in Java */

All of the above
Question 3 (1 point)

Question 3 Unsaved
What is the filename extension used for all Java compiled files.

Question 3 options:

.cs

.javac

.bytes

.class

None of the above
Question 4 (1 point)

Question 4 Unsaved
Select the correct line of Java code to assign 1000 to an int variable named myValue.
Question 4 options:

int myValue = 1000;

int myValue = 0x3E8;

int myValue = 0b1111101000;

All of the above

None of the above
Question 5 (1 point)

Question 5 Unsaved
Will the following Java code compile and run without errors?

public class QuizItem

{

public static void main(String[] args)

{

final int age = 38;

age = 39;

System.out.println(“Age is ” + age);

}

}
Question 5 options:

No

Yes
Question 6 (1 point)

Question 6 Unsaved
What is the output from the following Java code?
public class Week1Quiz {
public static void main (String[] args) {
System.out.println (“Welcome”);
System.out.println (“to”);
System.out.print (“UMUC!”);
}
}
Question 6 options:

Welcome to UMUC

None of the above

No output as the code will not compile.

Welcome

to

UMUC!

WelcometoUMUC
Question 7 (1 point)

Question 7 Unsaved
Given the following sequence of Java code:

int var = 4;

var++;

var = var + 2;

var–;

var = -var;

What is the final value of var?
Question 7 options:

4

-6

8

-9

None of the above
Question 8 (1 point)

Question 8 Unsaved
What character is assigned to the variable myChar in the following line of Java code?

char value = ‘u0023’;
Question 8 options:

null

?

X

#

y
Question 9 (1 point)

Question 9 Unsaved
The Java Application Programming Interface (API) is:
Question 9 options:

One component of the Java Platform

Libraries of related Java classes and interfaces

A ready-to-use collection of software components

All of the above
Question 10 (1 point)

Question 10 Unsaved
Given the following sequence of Java code:

int var1 = 0b0001;

int var2 = 0b1111;

int results1 = var1 & var2;

int results2 = var1 | var2;

int results3 = var1 ^ var2;

int printit = results1 + results2 + results3;

What are the values for results1, results2, results3 and printit after executing the code?

Question 10 options:

results1=15; results2=1; results3=14; printit = 15114

results1=1; results2=14; results3=15; printit = 29

results1=1; results2=15; results3=14; printit = 11514

results1=1; results2=15; results3=14; printit = 30

None of the above
Question 11 (1 point)

Question 11 Unsaved
What are bytecodes?
Question 11 options:

The Java VM

8 bits are used for each bytecode

The launcher tool for Java programs

The Java Compiler (javac)

None of the above
Question 12 (1 point)

Question 12 Unsaved
Select the invalid declaration from the lines of Java code below
Question 12 options:

int zebraCnt = 40000;

long birdCnt = 222_222_222_222_222L;

float avg = 23.5;

double avg = 98.32121;

None of the above. All are legal declaration.
Question 13 (1 point)

Question 13 Unsaved
If we declared the following variables in Java
int age = 27;

int cafe = 0xCAFE;

int number1 =0b0001;

What is the output for the following Java statement?
System.out.println(age + cafe + number1);

Question 13 options:

2720001

51994

54,false,A5194327

None of the above
Question 14 (1 point)

Question 14 Unsaved
What is the filename extension used for all Java source files.
Question 14 options:

.js

.java

.javac

.cs

None of the above
Question 15 (1 point)

Question 15 Unsaved
What development tool do you use to compile Java code?
Question 15 options:

java

appletviewer

javac

jar

javadoc
Question 16 (1 point)

Question 16 Unsaved
What is the output from the following Java code?
public class Week1Quiz {
public static void main (String[] args) {
System.out.print (“Welcome”);
System.out.print (“to “);
System.out.println (“UMUC”);
System.out.print (“!”);
}
}
Question 16 options:

WelcometoUMUC

Welcome

to

UMUC

Welcome to UMUC

!

No output as the code will not compile.

None of the above
Question 17 (1 point)

Question 17 Unsaved
What is the output from the following Java code?
public class Week1Quiz {
public static void main (String[] args) {
System.out.print (“Welcome”);
System.out.print (“to”);
System.out.print (“UMUC”);
}
}
Question 17 options:

WelcometoUMUC

Welcome

to

UMUC

Welcome to UMUC

No output as the code will not compile.

None of the above
Question 18 (1 point)

Question 18 Unsaved
Select the line of Java code that will correctly declare a float variable named average and assign the variable a value of 3.4.
Question 18 options:

int average = 3.4;

int average = 3.4f;

int average;

average = 3.4;

None of the above

int average = 3.4D;
Question 19 (1 point)

Question 19 Unsaved
The following java code was created to print “Hello, World!”
public class JavaQuiz
{
public static void main (String[] args)
{
System.out.println (“Hello, World!”);
}
}

What is the name of the Java source file?
Question 19 options:

HelloWorld.java

Quiz.java

Main.java

Insufficient information to determine

JavaQuiz.java
Question 20 (1 point)

Question 20 Unsaved
Which of the following is an invalid Java statement:
Question 20 options:

System.out.println(“Hello, World! “);

int d = 14;

d++;

x + y/100;

None of the above

Question 21 (1 point)

Question 21 Unsaved
What is the output from the following Java code?
public class Week1Quiz {
public static void main (String[] args) {
System.out.print (“Welcome”);
System.out.print (“to”);
System.out.print (“UMUC”);
}
}
Question 21 options:

Welcome to UMUC

Welcome

to

UMUC

Welcome to

UMUC

No output as the code will not compile.

None of the above
Question 22 (1 point)

Question 22 Unsaved
Select the Java code that will correctly declare a boolean variable named success and assign it a value of false.
Question 22 options:

Boolean success = true;

boolean success = 1;

boolean success = 0;

None of the above

int success = false;
Question 23 (1 point)

Question 23 Unsaved
Given the following sequence of Java code:

int var1 = 4;

int var2 = 6;

int var3 = 10;

int results = (var1 + var2) * var3 /(var1 + var3) – var2%var1;

What is the values of results after executing the code?

Question 23 options:

6

5

-2

9

None of the above
Question 24 (1 point)

Question 24 Unsaved
What must be installed on a computer to be able to run bytecodes?
Question 24 options:

Java Virtual Machine (VM)

Microsoft Visual Basic

Ubuntu Server

Oracle Database (11g or higher)

None of the above
Question 25 (1 point)

Question 25 Unsaved
Which of the following statements is a comment in Java
Question 25 options:

/ This is a test

public class Hello {

// This is a test. //

(String[] args)

None of the above

We are always aiming to provide top quality academic writing services that will surely enable you achieve your desired academic grades. Our support is round the clock!

Type of paper Academic level Subject area
Number of pages Paper urgency Cost per page:
 Total: