100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

Programming Practice

Rating
-
Sold
-
Pages
4
Uploaded on
02-05-2022
Written in
2021/2022

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

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Study Level
Publisher
Subject
Course

Document information

Uploaded on
May 2, 2022
Number of pages
4
Written in
2021/2022
Type
Other
Person
Unknown

Subjects

Content preview

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
$11.71
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
cdfkmgkjnfjn

Document also available in package deal

Get to know the seller

Seller avatar
cdfkmgkjnfjn Abacus College, Oxford
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
3 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions