Computer Science

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 2 (1 point)

Question 2 Unsaved

Select the valid Java comments from the statements below.

Question 3 (1 point)

Question 3 Unsaved

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

 

Question 4 (1 point)

Question 4 Unsaved

Select the correct line of Java code to assign 1000 to an int variable named myValue.

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 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 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 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 9 (1 point)

Question 9 Unsaved

The Java Application Programming Interface (API) is:

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 11 (1 point)

Question 11 Unsaved

What are bytecodes?

Question 12 (1 point)

Question 12 Unsaved

Select the invalid declaration from the lines of Java code below

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 14 (1 point)

Question 14 Unsaved

What is the filename extension used for all Java source files.

Question 15 (1 point)

Question 15 Unsaved

What development tool do you use to compile Java code?

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 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 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 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 20 (1 point)

Question 20 Unsaved

Which of the following is an invalid Java statement:

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 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 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 24 (1 point)

Question 24 Unsaved

What must be installed on a computer to be able to run bytecodes?

Question 25 (1 point)

Question 25 Unsaved

Which of the following statements is a comment in Java

Order now and get 10% discount on all orders above $50 now!!The professional are ready and willing handle your assignment.

ORDER NOW »»