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.









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

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
£8.49
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

Also available in package deal

Thumbnail
Package deal
Programming Practice Documents
-
2 2022
£ 16.98 More info

Get to know the seller

Seller avatar
cdfkmgkjnfjn Abacus College, Oxford
View profile
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 revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

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

Student with book image

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

Alisha Student

Frequently asked questions