You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Know the term perceptual blindness, and know can learn to regodnize essential (and unessential) things with practice.
10
+
11
+
- Know the term perceptual blindness, and can learn to recognize essential (and non-essential) information with practice.
11
12
- Know ways to comment code, and understand the importance of variable names on readability of your code.
12
13
- Know the concept print-debugging, and know how to search for errors in the source code by printing.
13
14
@@ -264,7 +265,7 @@ if (sum == 0) {
264
265
265
266
<!-- Mikäli ohjelmassa olisi virhe, print-debuggauksella ohjelman toimintaa voisi purkaa lisäämällä print-komentoja sopiviin kohtiin. Alla olevassa esimerkissä on eräs mahdollinen esimerkki print-debuggauskomentoja sisältävästä ohjelmasta. -->
266
267
267
-
Had the program container an error, print debugging could have been used to unravel its functionality by adding print statements in the appropriate places. The example below contains one possible example of a program containing print-debug statements.
268
+
Had the program contained an error, print debugging could have been used to unravel its functionality by adding print statements in the appropriate places. The example below contains one possible example of a program containing print-debug statements.
Copy file name to clipboardExpand all lines: data/part-3/2-lists.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1048,7 +1048,7 @@ numbers.add(2);
1048
1048
numbers.add(3);
1049
1049
numbers.add(4);
1050
1050
1051
-
int index =numbres.size() -1;
1051
+
int index =numbers.size() -1;
1052
1052
while (index >=0) {
1053
1053
int number = numbers.get(index);
1054
1054
System.out.println(number);
@@ -1083,7 +1083,7 @@ Try and recreate the previous example with the for loop!
1083
1083
1084
1084
<!-- Seuraavissa tehtävissä harjoitellaan listan ja indeksin käyttöä. Vaikka pystyisit tekemään tehtävät ilman listaa, keskity tehtävissä listan käytön harjoitteluun. Tehtävissä toivottu toiminnallisuus tulee toteuttaa lukujen lukemisen jälkeen. -->
1085
1085
1086
-
The next exercises are meant for learning to use lists and indices. Even if you could complete the execises without a list, concentrate on training to use it. The functionality in the exercises is to be implemented after reading the input numbers.
1086
+
The next exercises are meant for learning to use lists and indices. Even if you could complete the exercises without a list, concentrate on training to use it. The functionality in the exercises is to be implemented after reading the input numbers.
1087
1087
1088
1088
</text-box>
1089
1089
@@ -1372,7 +1372,7 @@ The greatest number: 93
1372
1372
1373
1373
<!-- Ota mallia allaolevasta pienintä lukua etsivästä lähdekoodista. -->
1374
1374
1375
-
You can use the source code below as an inspitation. It is used to find the smallest number.
1375
+
You can use the source code below as an example. It is used to find the smallest number.
1376
1376
1377
1377
<!-- ```java
1378
1378
// oletetaan, että käytössämme on lista, jossa on kokonaislukuja
@@ -1416,7 +1416,11 @@ The exercise template contains a base that reads numbers from the user and adds
1416
1416
1417
1417
<!-- Lisää ohjelmaan toiminnallisuus, joka kysyy käyttäjältä lukua ja kertoo luvun indeksin. Mikäli lukua ei löydy, ohjelman ei tule kertoa siitä. -->
1418
1418
1419
+
<<<<<<< HEAD
1419
1420
Expand the program that then asks the user for a number, and report that number's index in the list. If the number is not found, the program should not print anything.
1421
+
=======
1422
+
Expand the program that then asks the user for a number, and reports that number's index in the list. If the number is not found, the program should not print anything.
1423
+
>>>>>>> 308016b9436e2658c73658131796fd7e412f3cd7
1420
1424
1421
1425
<!-- <sample-output>
1422
1426
@@ -1588,7 +1592,7 @@ for (String teacher: teachers) {
1588
1592
1589
1593
<!-- Yllä kuvattu for-each toistolause käytännössä piilottaa osan aiemmin harjoittelemastamme for-toistolauseesta. Edellä kuvattu for-each toistolause näyttäisi for-toistolauseella toteutettuna seuraavalta: -->
1590
1594
1591
-
In practical terms, the for-each loop described above hides some parts of the for-loop we practiced earlier.The for-each loop would look like this if implemented as a for-loop:
1595
+
In practical terms, the for-each loop described above hides some parts of the for-loop we practiced earlier.The for-each loop would look like this if implemented as a for-loop:
1592
1596
1593
1597
<!-- ```java
1594
1598
ArrayList<String> opettajat = new ArrayList<>();
@@ -1613,7 +1617,7 @@ teachers.add("Samuel");
1613
1617
teachers.add("Ann");
1614
1618
teachers.add("Anna");
1615
1619
for (int i =0; i < teachers.size(); i++) {
1616
-
String teacher =teacher.get(i);
1620
+
String teacher =teachers.get(i);
1617
1621
// contents of the for each loop:
1618
1622
System.out.println(teacher);
1619
1623
}
@@ -1707,7 +1711,7 @@ Average: 23.25
1707
1711
1708
1712
<!-- Listan metodi **remove** poistaa listalta parametrina annettuun indeksiin liittyvän arvon. Parametri annetaan kokonaislukuna. -->
1709
1713
1710
-
The list's \*_remove_ method removes the value that is located at the index that's given as the parameter. The parameter is an integer.
1714
+
The list's **remove** method removes the value that is located at the index that's given as the parameter. The parameter is an integer.
1711
1715
1712
1716
<!-- ```java
1713
1717
ArrayList<String> lista = new ArrayList<>();
@@ -1892,7 +1896,7 @@ Toka löytyi yhä
1892
1896
1893
1897
<sample-output>
1894
1898
1895
-
Can we find first? true
1899
+
Is the first found? true
1896
1900
Second was found
1897
1901
Second can still be found
1898
1902
@@ -1962,7 +1966,7 @@ Logan was not found!
1962
1966
1963
1967
<!-- Kuten muutkin muuttujat, myös listan voi asettaa metodin parametriksi. Kun lista määritellään metodin parametriksi, määritellään parametrin tyypiksi listan tyyppi sekä listan sisältämien arvojen tyyppi. Alla oleva metodi `tulosta` tulostaa listan arvot yksitellen. -->
1964
1968
1965
-
Like other variables, a list, too, can be used as a parameter to a method. When the method is defined to take a list as a parameter, the type of the parameter is defined as the type of the list and the type of the values contained in that list. Below, the method `print` prints the values in the list one by one.
1969
+
Like other variables, a listcan be used as a parameter to a method too. When the method is defined to take a list as a parameter, the type of the parameter is defined as the type of the list and the type of the values contained in that list. Below, the method `print` prints the values in the list one by one.
1966
1970
1967
1971
<!-- ```java
1968
1972
public static void tulosta(ArrayList<String> lista) {
0 commit comments