100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Programming Practice £8.49   Add to cart

Other

Programming Practice

 9 views  0 purchase

These documents will help you learn coding, assisting you in succeeding in your course.

Preview 1 out of 4  pages

  • May 2, 2022
  • 4
  • 2021/2022
  • Other
  • Unknown
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
All documents for this subject (91)
avatar-seller
cdfkmgkjnfjn
Unit 4: Programming
Tutorial :Arrays
To be used in week 12, week beginning 13 March 2021.


1. What are the default values for the double and boolean types in an array declaration?
Answer:
(a) double:
(b) boolean:
2. Declare an array of three integers containing 3, 7 and 8 (in that order).
Answer:




3. Given the declaration
int [ ] t a b l e = new int [ 2 ] ;

How long is the array and what is the valid range of indices?
Answer:
(a) Length:
(b) Range:
4. Consider the array arr[] = {1, 3, 4, 2, -1};, which we represent diagrammatically in the table below, if
the following operations (in the stated order) are applied;

(a) arr[0] = a[0] + 1;
(b) arr[1] = a[1] + 2;
(c) arr[2] += a[1];
(d) arr[3] = a[1] + a[2];

what are the final values in the array?

start finish
0 1
1 3
2 4
3 2
4 -1


1

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 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 cdfkmgkjnfjn. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73216 documents were sold in the last 30 days

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

Start selling
£8.49
  • (0)
  Add to cart