100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COSC 236 FINAL EXAM STUDY QUESTIONS AND ANSWERS $12.99   Add to cart

Exam (elaborations)

COSC 236 FINAL EXAM STUDY QUESTIONS AND ANSWERS

 5 views  0 purchase
  • Course
  • Cosc
  • Institution
  • Cosc

COSC 236 FINAL EXAM STUDY QUESTIONS AND ANSWERS

Preview 2 out of 11  pages

  • August 24, 2024
  • 11
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Cosc
  • Cosc
avatar-seller
millyphilip
COSC 236 FINAL EXAM STUDY
QUESTIONS AND ANSWERS

1. This indicates the number of elements, or values, the array can hold.

a. the new operator
b. the array's size declarator
c. the array's data type
d. the version of Java - Answer -b. the array's size declarator

2. What does the following statement do?

double[] array1 = new double[10];

a. Declares array1 to be a reference to an array of double values
b. Creates an instance of an array of 10 double values
c. Will allow valid subscripts in the range of 0 - 9
d. All of the above - Answer -d. all of the above

3. It is common practice to use a ____________ variable as a size declarator.

a. static
b. reference
c. final
d. boolean - Answer -c. final

4. What do you call the number that is used as an index to pinpoint a specific element
within an array?

a. subscript
b. global unique identifier
c. element
d. argument - Answer -a. subscript

5. Subscript numbering always starts at what value?

a. 0

, b. 1
c. -1
d. None of the above - Answer -a. 0

6. By default, Java initializes array elements with what value?

a. 0
b. 100
c. 1
d. -1 - Answer -a. 0

7. What will be the value of x[8] after the following code has been executed?

final int SUB = 12;
int[] x = new int[SUB];
int y = 100;

for(int i = 0; i < SUB; i++) {
x[i] = y;
y += 10;
}

a. 170
b. 180
c. 190
d. 200 - Answer -b. 180

8. Java performs ____________, which means that it does not allow a statement to use
a subscript that is outside the range of valid subscripts for the array.

a. active array sequencing
b. array bounds checking
c. scope resolution binding
d. buffer overrun protection - Answer -b. array bounds checking

9. In Java, you do not use the new operator when you use a(n):

a. array size declarator
b. initialization list
c. two-dimensional array
d. All of the above - Answer -b. initialization list

10. What will be the results of the following code?

final int ARRAY_SIZE = 5;
double[] x = new double[ARRAY_SIZE];

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller millyphilip. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

82191 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.99
  • (0)
  Add to cart