Skip to content

Commit f4fe618

Browse files
committed
Merge branch 'newBranch' of https://github.com/kevin0110w/java-programming into kevin0110w-newBranch
2 parents 425de8d + 308016b commit f4fe618

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

data/part-3/1-discovering-errors.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ hidden: false
77

88
<!-- <text-box variant='learningObjectives' name='Oppimistavoitteet'> -->
99
<text-box variant='learningObjectives' name='Learning Objectives'>
10-
- 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.
1112
- Know ways to comment code, and understand the importance of variable names on readability of your code.
1213
- Know the concept print-debugging, and know how to search for errors in the source code by printing.
1314

@@ -264,7 +265,7 @@ if (sum == 0) {
264265

265266
<!-- 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. -->
266267

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.
268269

269270
<!--
270271
```java

data/part-3/2-lists.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ numbers.add(2);
10481048
numbers.add(3);
10491049
numbers.add(4);
10501050

1051-
int index = numbres.size() - 1;
1051+
int index = numbers.size() - 1;
10521052
while (index >= 0) {
10531053
int number = numbers.get(index);
10541054
System.out.println(number);
@@ -1083,7 +1083,7 @@ Try and recreate the previous example with the for loop!
10831083

10841084
<!-- 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. -->
10851085

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.
10871087

10881088
</text-box>
10891089

@@ -1372,7 +1372,7 @@ The greatest number: 93
13721372

13731373
<!-- Ota mallia allaolevasta pienintä lukua etsivästä lähdekoodista. -->
13741374

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.
13761376

13771377
<!-- ```java
13781378
// 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
14161416

14171417
<!-- 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ä. -->
14181418

1419+
<<<<<<< HEAD
14191420
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
14201424
14211425
<!-- <sample-output>
14221426
@@ -1588,7 +1592,7 @@ for (String teacher: teachers) {
15881592

15891593
<!-- 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: -->
15901594

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:
15921596

15931597
<!-- ```java
15941598
ArrayList<String> opettajat = new ArrayList<>();
@@ -1613,7 +1617,7 @@ teachers.add("Samuel");
16131617
teachers.add("Ann");
16141618
teachers.add("Anna");
16151619
for (int i = 0; i < teachers.size(); i++) {
1616-
String teacher = teacher.get(i);
1620+
String teacher = teachers.get(i);
16171621
// contents of the for each loop:
16181622
System.out.println(teacher);
16191623
}
@@ -1707,7 +1711,7 @@ Average: 23.25
17071711

17081712
<!-- Listan metodi **remove** poistaa listalta parametrina annettuun indeksiin liittyvän arvon. Parametri annetaan kokonaislukuna. -->
17091713

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.
17111715

17121716
<!-- ```java
17131717
ArrayList<String> lista = new ArrayList<>();
@@ -1892,7 +1896,7 @@ Toka löytyi yhä
18921896

18931897
<sample-output>
18941898

1895-
Can we find first? true
1899+
Is the first found? true
18961900
Second was found
18971901
Second can still be found
18981902

@@ -1962,7 +1966,7 @@ Logan was not found!
19621966

19631967
<!-- 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. -->
19641968

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 list can 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.
19661970

19671971
<!-- ```java
19681972
public static void tulosta(ArrayList<String> lista) {

0 commit comments

Comments
 (0)