For Tutorial 4

From Progzoo
Jump to: navigation, search

An Array of Integers

You can loop over an Array without using an index:

for (int v:a)

Change the program so that it prints twice the value:

4
14
10
6


[Font] [Default] [Show] [Resize] [History] [Profile]

Another Array of Integers

Change the program so that it prints the number and twice the value:

2 4
7 14
5 10
3 6


[Font] [Default] [Show] [Resize] [History] [Profile]

An Array of String

Write out each string in the Array:

Hydrogen
Helium
Lithium
Beryllium


[Font] [Default] [Show] [Resize] [History] [Profile]