Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 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

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

Connected book

Written for

Study Level
Examinator
Subject
Unit

Document information

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

Subjects

$12.38
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
cdfkmgkjnfjn

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
-
Member since
4 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions