cs 3300 ling xu UHD QUIZZ 1 Question 1 5 out of 5 points Ja

cs 3300 : ling xu UHD

QUIZZ: 1

Question 1

5 out of 5 points

Java compiler translates your Java program into a language called_____________, which is the machine language for a fictitious computer called the Java Virtual Machine (JVM).

Question 2

0 out of 5 points

In the following statement, Java first evaluates (kids !=0) is True or False. If it\'s False, there would be no need to evaluate the second expression. This method of evaluation is called _____________.

if ( (kids != 0) && ((pieces/kids) >= 2) )

  System.out.println(\"Each child may have two pieces!\");

Question 3

1 out of 5 points

There are a number of errors in the program MyFirstProgram.java as shown in the following. Locate and correct as many as you can.

public class JavaDemo ;

{

public static void main(String[] args)

{

System.out.println(\"Hello World\");

}

}

Question 4

5 out of 5 points

What is the output produced by the following?

int number = 10;

while (number > 0)

{ number = number - 2;

if (number == 4)

break;

System.out.println(number);

}

System.out.println(\"The end.\");

Monday, October 17, 2016 12:00:59 PM CDT

QUIZ 2:

Question 1

2 out of 2 points

A set method is:

Question 2

2 out of 2 points

To terminate a program, use the Java statement:

Question 3

0 out of 2 points

A variable whose meaning is confined to an object of a class is called:

Question 4

2 out of 2 points

Java has a way of officially hiding details of a class definition. To hide details, you mark them as

Question 5

10 out of 12 points

Write a Java class named Student that has data attributes name, id, and gpa. Include a default constructor to initialize the fields.

Monday, October 17, 2016 12:00:14 PM CDT

QUIZ 3:

Question 1

1 out of 1 points

The conversion from an object of a wrapper class to a value of its associated primitive type is called:

Question 2

1 out of 1 points

A copy constructor has _________ parameters.

Question 3

1 out of 1 points

The correct syntax for accessing the length of an array named Numbers is:

Question 4

12 out of 12 points

Based on the given UML class diagram in the following, write the definition of class Square in Java.

Question 5

4 out of 5 points

Declare and create a two dimentional array to hold the first and last names of 10 people.

Monday, October 17, 2016 11:56:26 AM CDT

Java compiler translates your Java program into a language called_____________, which is the machine language for a fictitious computer called the Java Virtual Machine (JVM).

Solution

ans 1)Byte code

ans 3)NO errors

aans 4)8,6 ,the end.

quiz 2:

1 ans)set method assign value to variable

2 ans)System.exit(0)

3 ans)local variable

4 ans)abstraction

5 ans)Student(String name,int id,char gpa){

this.name=name;

this.id=id;

this.gpa=gpa;

}

quiz 3:

ans 1)autoboxing

ans 2)arguments need to have default values

ans 3)Numbers.length();

ans 4)public class square{

pubic vlid area(){

int area=s*s;

System.out.println(area);

ans 5)

String[][] names= new String[4][4];

values[0][0] = \"se\";

valuse[0][1]=\"jsjs\";

cs 3300 : ling xu UHD QUIZZ: 1 Question 1 5 out of 5 points Java compiler translates your Java program into a language called_____________, which is the machine
cs 3300 : ling xu UHD QUIZZ: 1 Question 1 5 out of 5 points Java compiler translates your Java program into a language called_____________, which is the machine
cs 3300 : ling xu UHD QUIZZ: 1 Question 1 5 out of 5 points Java compiler translates your Java program into a language called_____________, which is the machine

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site