Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 33 (0.75 points) After the following code is run, which array element contains the letter Q ? String [ ] names = new String

Question 33 (0.75 points)

After the following code is run, which array element contains the letter "Q" ?

String [ ] names = new String [10]; names[5] = "Q";

Question 33 options:

the 4th element

the 5th element

the 6th element

the 7th element

Question 34 (0.75 points)

Any for loop can be re-written as

Question 34 options:

an arithmetic operation

a while loop

an if-statement

a for-each loop

Question 35 (0.75 points)

Which of the following gives you the size of an array named 'numbers'?

Question 35 options:

numbers.size()

numbers.length

numbers.size

numbers.length()

Question 36 (0.75 points)

Accessing indices outside the bounds of an array will lead to

Question 36 options:

a runtime error: ArrayIndexOutOfBoundsException

a compile error

no error, but corrupt data

additional memory will be added to the array, making the new indices valid

Question 37 (1.5 points)

Match the situation with the best choice of loop:

Question 37 options:

123

Iterate through the elements of a collection

123

Determine when the loop should stop on the fly

123

Execute a set of statements a fixed number of times

123

Use a variable inside the loop whose value changes by a fixed amount

1.

for-each

2.

for

3.

while

Question 38 (0.75 points)

Match each term with a definition.

Question 38 options:

123

Collection

123

Set

123

Map

1.

Collection object that can store an arbitrary number of other objects.

2.

Collection that stores key/value pairs as entries. Values can be looked up by providing the key.

3.

Collection that stores each individual element at most once. It does not maintain any specific order.

Question 39 (0.74 points)

Write the signature of the main method that is the starting point for a Java program (starting with "public"). Answer is case-sensitive since Java is case-sensitive.

Question 39 options:

Question 40 (Mandatory) (0.01 points)

The following resources are allowed during the exam:

  • Your textbook
  • Your notes (electronic or hardcopy)
  • BlueJ
  • All materials on our course web site, including all your past work & exams (anything you can access on the course web site)
  • Any of the web sites linked to in the Java Resources box on our course home page.
  • Any other web sites you have been using as a Java or programming reference during this course.

Type your name in the box to attest that you have not used any other resources, and you have not performed any internet searches during this exam.

Question 40 options:

Previous PageNext Page

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What is database?

Answered: 1 week ago

Question

What are Mergers ?

Answered: 1 week ago