ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 8.00

String number = ""one

Question 11

Given

int quantity = 3

double value = 7.52

String number = ""one

Which of all of the following are valid assignments?

A. quantity = value

B. quantity = (int)value

C. value = quantity

D. quantity = (double)value

E. quantity = number

F. Both B and C

 

 

Question 12

Select the best answer.

A(n) ____ can add instance variables and methods to an existing class.

A. subclass

B. polymorphism

C. superclass

D. constructor

 

 

Question 13

What is the error in the following code fragment?

double data[] = new double[20]

data[20] = 15.25

A. Out-of-bounds error

B. Data not initialized

C. A two-dimensional array is required

D. A cast is required

 

 

Question 14

If you know that your loop must iterate at least one time, it is recommended that you use a _________ loop

A. do _ while

B. repeat

C. for

D. while

 

 

 

Question 15

Multiplying an int (such as 5) by a double (such as 0.1) gives

A. an exception is thrown

B. an int

C. an error

D. a double

 

 

Question 16

After executing this code segment

double v1 = 2000.0

double v2 = v1

v2 = v2 + 500.0

What will be the value of v1?

A. Unknown

B. 2000.0

C. 2500.0

D. 0.0

 

 

Question 17

Which of the following indicates that a method does not return a value?

A. double

B. static

C. void

D. public

 

 

Question 18

Where an inherited method is overridden, the type of the actual object, not the type of the reference to the object is used to determine which method to call?

True

False

 

 

Question 19

The compiler will generate an error if the same name but different signature is used for more than one method or constructor.

True

False

 

 

Question 20

Given this code fragment

int x = 5, y = 6, z = 7

foo(x, y, z)

System.out.println(x + "", "" + y + "", "" + z)

public void foo(int a, int b, int c)

a = a + 3

b = a + c

c = c + b

What is the output?

A. 5, 6, 7

B. 8, 12, 13

C. 2, 0, 4

D. 8, 15, 22

 

 

Answers

(11)
Status NEW Posted 24 May 2017 04:05 AM My Price 8.00

-----------

Not Rated(0)