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
<!-- Ohjelmaan on toteutettu valmiina pohja, joka lukee käyttäjältä merkkijonoja ja lisää niitä listalle. Syötteiden lukeminen päätetään kun käyttäjä syöttää tyhjän merkkijonon. Ohjelma tulostaa tämän jälkeen listan ensimmäisen arvon. -->
@@ -403,7 +403,7 @@ Mary
403
403
404
404
<!-- <programming-exercise name='Toisen ja kolmannen summa' tmcname='osa03-Osa03_02.ToisenJaKolmannenSumma'> -->
405
405
406
-
<programming-exercisename='Sum of second and third'tmcname='osa03-Osa03_02.ToisenJaKolmannenSumma'>
406
+
<programming-exercisename='Second plus third'tmcname='part03-Part03_02.SecondPlusThird'>
407
407
408
408
409
409
@@ -501,7 +501,7 @@ Since zero is the first value used in numbering the places (i.e. **indexing**),
501
501
The error message also hints at the capsulated implementation of an ArrayList object. It lists the methods that were called when the error occured. First the program called the `main` method. Then the main method called the `get` method of ArrayList. After this the `get` method in ArrayList called the `rangeCheck` method, in which the error occurred. This is also an instance of good naming of methods. Despite never hearing of the method `rangeCheck`, we can with good reason guess that it checks if a place is contained in the wanted range. The error likely occurred because this was not the case.
<!-- Tehtäväpohjassa on ohjelma, joka lukee käyttäjältä syötteitä. Muokkaa ohjelman toimintaa siten, että kun syötteiden lukeminen lopetetaan, ohjelma tulostaa listalla olevien arvojen lukumäärän. -->
@@ -815,7 +815,7 @@ In total: 11
815
815
816
816
<!-- Huom! Käytä tässä listan valmiiksi tarjoamaa metodia `size`. -->
817
817
818
-
N.B.! Be sure to make the `size` method of the list.
818
+
N.B.! Be sure to use the `size` method of the list.
819
819
820
820
</programming-exercise>
821
821
@@ -1135,7 +1135,7 @@ The next exercises are meant for learning to use lists and indices. Even if you
1135
1135
1136
1136
<!-- <programming-exercise name='Listan viimeinen arvo' tmcname='osa03-Osa03_05.ListanViimeinenArvo'> -->
1137
1137
1138
-
<programming-exercisename='Last value in a list'tmcname='osa03-Osa03_05.ListanViimeinenArvo'>
1138
+
<programming-exercisename='Last in list'tmcname='part03-Part03_05.LastInList'>
1139
1139
1140
1140
<!-- Tehtäväpohjassa on ohjelma, joka lukee käyttäjältä syötteitä ja lisää syötteet listalle. Syötteen lukeminen lopetetaan kun käyttäjä syöttää tyhjän merkkijonon. -->
1141
1141
@@ -1209,7 +1209,7 @@ Oscar
1209
1209
1210
1210
<!-- <programming-exercise name='Ensimmäinen ja viimeinen arvo' tmcname='osa03-Osa03_06.EnsimmainenJaViimeinenArvo'> -->
1211
1211
1212
-
<programming-exercisename='First and last values'tmcname='osa03-Osa03_06.EnsimmainenJaViimeinenArvo'>
1212
+
<programming-exercisename='First and last'tmcname='part03-Part03_06.FirstAndLast'>
1213
1213
1214
1214
<!-- Tehtäväpohjassa on ohjelma, joka lukee käyttäjältä syötteitä ja lisää syötteet listalle. Syötteen lukeminen lopetetaan kun käyttäjä syöttää tyhjän merkkijonon. -->
<!-- Ohjelmaan on toteutettu valmiina pohja, joka lukee käyttäjältä lukuja listalle. Syötteiden lukeminen päätetään kun käyttäjä syöttää luvun -1. -->
@@ -1499,8 +1499,8 @@ Luku 2 on indeksissä 1
1499
1499
**11**
1500
1500
**-1**
1501
1501
1502
-
What number is searched for? **2**
1503
-
Number 2 is at index 1
1502
+
Search for? **2**
1503
+
2 is at index 1
1504
1504
1505
1505
</sample-output>
1506
1506
@@ -1528,9 +1528,9 @@ Luku 8 on indeksissä 3
1528
1528
**11**
1529
1529
**-1**
1530
1530
1531
-
What number is searched for? **8**
1532
-
Number 8 is at index 2
1533
-
Number 8 is at index 3
1531
+
Search for? **8**
1532
+
8 is at index 2
1533
+
8 is at index 3
1534
1534
1535
1535
</sample-output>
1536
1536
@@ -1539,7 +1539,7 @@ Number 8 is at index 3
1539
1539
1540
1540
<!-- <programming-exercise name='Pienimmän luvun indeksi' tmcname='osa03-Osa03_11.PienimmanLuvunIndeksi'> -->
1541
1541
1542
-
<programming-exercisename='Index of the smallest number'tmcname='osa03-Osa03_11.PienimmanLuvunIndeksi'>
1542
+
<programming-exercisename='Index of smallest'tmcname='part03-Part03_11.IndexOfSmallest'>
1543
1543
1544
1544
<!-- Toteuta ohjelma, joka lukee käyttäjältä lukuja. Kun käyttäjä syöttää luvun 9999, lukujen lukeminen lopetetaan. Ohjelma tulostaa tämän jälkeen pienimmän listalla olevan luvun sekä indeksit, joista pienin luku löytyy. Pienin luku voi siis esiintyä useamman kerran. -->
1545
1545
@@ -1569,8 +1569,9 @@ Pienin luku löytyy indeksistä 1
1569
1569
**11**
1570
1570
**9999**
1571
1571
1572
-
The smallest number is 2
1573
-
The smallest number is found at index 1
1572
+
Smallest number: 2
1573
+
Found at index: 1
1574
+
1574
1575
1575
1576
</sample-output>
1576
1577
@@ -1600,9 +1601,9 @@ Pienin luku löytyy indeksistä 3
<!-- Luo tehtäväpohjaan metodi `public static int summa(ArrayList<Integer> luvut)`. Metodin tulee palauttaa parametrina annetun listan lukujen summa. -->
<!-- Luo tehtäväpohjaan metodi `public static void poistaViimeinen(ArrayList<String> mjonot)`. Metodin tulee poistaa parametrina saadusta listasta viimeisin arvo. Mikäli lista on tyhjä, metodin ei tule tehdä mitään. -->
0 commit comments