Skip to content

Commit 1fd5cff

Browse files
author
Heinonen Ava R
committed
part 3 exercise check
1 parent c19f88d commit 1fd5cff

4 files changed

Lines changed: 63 additions & 64 deletions

File tree

data/osa-3/2-listat.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ Second
343343

344344
<!-- <programming-exercise name='Kolmannen arvon tulostaminen' tmcname='osa03-Osa03_01.KolmannenArvonTulostaminen'> -->
345345

346-
<programming-exercise name='Printing the third value' tmcname='osa03-Osa03_01.KolmannenArvonTulostaminen'>
346+
<programming-exercise name='Third element' tmcname='part03-Part03_01.ThirdElement'>
347347

348348

349349
<!-- 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
403403

404404
<!-- <programming-exercise name='Toisen ja kolmannen summa' tmcname='osa03-Osa03_02.ToisenJaKolmannenSumma'> -->
405405

406-
<programming-exercise name='Sum of second and third' tmcname='osa03-Osa03_02.ToisenJaKolmannenSumma'>
406+
<programming-exercise name='Second plus third' tmcname='part03-Part03_02.SecondPlusThird'>
407407

408408

409409

@@ -501,7 +501,7 @@ Since zero is the first value used in numbering the places (i.e. **indexing**),
501501
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.
502502

503503

504-
<programming-exercise name='IndexOutOfBoundsException' tmcname='osa03-Osa03_03.IndexOutOfBoundsException'>
504+
<programming-exercise name='IndexOutOfBoundsException' tmcname='part03-Part03_03.IndexOutOfBoundsException'>
505505

506506

507507
<!-- Lista on erittäin hyödyllinen kun halutaan säilöä muuttujien arvoja myöhempää käsittelyä varten. Sillä on myös helpohko tehdä virheitä. -->
@@ -746,7 +746,7 @@ Number of values on the list: 1
746746

747747
<!-- <programming-exercise name='Listan koko' tmcname='osa03-Osa03_04.ListanKoko'> -->
748748

749-
<programming-exercise name='Size of list' tmcname='osa03-Osa03_04.ListanKoko'>
749+
<programming-exercise name='Size matters' tmcname='part03-Part03_04.SizeMatters'>
750750

751751

752752
<!-- 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
815815

816816
<!-- Huom! Käytä tässä listan valmiiksi tarjoamaa metodia `size`. -->
817817

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

820820
</programming-exercise>
821821

@@ -1135,7 +1135,7 @@ The next exercises are meant for learning to use lists and indices. Even if you
11351135

11361136
<!-- <programming-exercise name='Listan viimeinen arvo' tmcname='osa03-Osa03_05.ListanViimeinenArvo'> -->
11371137

1138-
<programming-exercise name='Last value in a list' tmcname='osa03-Osa03_05.ListanViimeinenArvo'>
1138+
<programming-exercise name='Last in list' tmcname='part03-Part03_05.LastInList'>
11391139

11401140
<!-- 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. -->
11411141

@@ -1209,7 +1209,7 @@ Oscar
12091209

12101210
<!-- <programming-exercise name='Ensimmäinen ja viimeinen arvo' tmcname='osa03-Osa03_06.EnsimmainenJaViimeinenArvo'> -->
12111211

1212-
<programming-exercise name='First and last values' tmcname='osa03-Osa03_06.EnsimmainenJaViimeinenArvo'>
1212+
<programming-exercise name='First and last' tmcname='part03-Part03_06.FirstAndLast'>
12131213

12141214
<!-- 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. -->
12151215

@@ -1284,7 +1284,7 @@ Oscar
12841284

12851285
<!-- <programming-exercise name='Listan luvut' tmcname='osa03-Osa03_07.ListanLuvut'> -->
12861286

1287-
<programming-exercise name='Numbers in the list' tmcname='osa03-Osa03_07.ListanLuvut'>
1287+
<programming-exercise name='Remember these numbers' tmcname='part03-Part03_07.RememberTheseNumbers'>
12881288

12891289
<!-- 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. -->
12901290

@@ -1314,7 +1314,7 @@ Expand the functionality of the program so that after reading the numbers, it pr
13141314

13151315
<!-- <programming-exercise name='Luvut rajatulla alueella' tmcname='osa03-Osa03_08.LuvutRajatullaAlueella'> -->
13161316

1317-
<programming-exercise name='Numbers in a given range' tmcname='osa03-Osa03_08.LuvutRajatullaAlueella'>
1317+
<programming-exercise name='Only these numbers' tmcname='part03-Part03_08.OnlyTheseNumbers'>
13181318

13191319
The exercise template contains a base that reads numbers from the user and adds them to a list. Reading is stopped once the user enters the number -1.
13201320

@@ -1388,7 +1388,7 @@ To where? **2**
13881388

13891389
<!-- <programming-exercise name='Listan suurin luku' tmcname='osa03-Osa03_09.ListanSuurinLuku'> -->
13901390

1391-
<programming-exercise name='Greatest number in the list' tmcname='osa03-Osa03_09.ListanSuurinLuku'>
1391+
<programming-exercise name='Greatest in list' tmcname='part03-Part03_09.GreatestInList'>
13921392

13931393

13941394
<!-- 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. -->
@@ -1465,7 +1465,7 @@ System.out.println("The smallest number: " + smallest);
14651465

14661466
<!-- <programming-exercise name='Kysytyn luvun indeksi' tmcname='osa03-Osa03_10.KysytynLuvunIndeksi'> -->
14671467

1468-
<programming-exercise name='Index of the requested number' tmcname='osa03-Osa03_10.KysytynLuvunIndeksi'>
1468+
<programming-exercise name='Index of' tmcname='part03-Part03_10.Indexof'>
14691469

14701470

14711471
<!-- 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
14991499
**11**
15001500
**-1**
15011501

1502-
What number is searched for? **2**
1503-
Number 2 is at index 1
1502+
Search for? **2**
1503+
2 is at index 1
15041504

15051505
</sample-output>
15061506

@@ -1528,9 +1528,9 @@ Luku 8 on indeksissä 3
15281528
**11**
15291529
**-1**
15301530

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
15341534

15351535
</sample-output>
15361536

@@ -1539,7 +1539,7 @@ Number 8 is at index 3
15391539

15401540
<!-- <programming-exercise name='Pienimmän luvun indeksi' tmcname='osa03-Osa03_11.PienimmanLuvunIndeksi'> -->
15411541

1542-
<programming-exercise name='Index of the smallest number' tmcname='osa03-Osa03_11.PienimmanLuvunIndeksi'>
1542+
<programming-exercise name='Index of smallest' tmcname='part03-Part03_11.IndexOfSmallest'>
15431543

15441544
<!-- 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. -->
15451545

@@ -1569,8 +1569,9 @@ Pienin luku löytyy indeksistä 1
15691569
**11**
15701570
**9999**
15711571

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+
15741575

15751576
</sample-output>
15761577

@@ -1600,9 +1601,9 @@ Pienin luku löytyy indeksistä 3
16001601
**9999**
16011602

16021603

1603-
The smallest number is 8
1604-
The smallest number is found at index 2
1605-
The smallest number is found at index 3
1604+
Smallest number: 8
1605+
Found at index: 2
1606+
Found at index: 3
16061607

16071608
</sample-output>
16081609

@@ -1696,7 +1697,7 @@ xxx
16961697

16971698
<!-- <programming-exercise name='Listan lukujen summa' tmcname='osa03-Osa03_12.ListanLukujenSumma'> -->
16981699

1699-
<programming-exercise name='Sum of numbers in the list' tmcname='osa03-Osa03_12.ListanLukujenSumma'>
1700+
<programming-exercise name='Sum of a list' tmcname='part03-Part03_12.SumOfAList'>
17001701

17011702

17021703
<!-- 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. -->
@@ -1736,7 +1737,7 @@ Sum: 93
17361737

17371738
<!-- <programming-exercise name='Listan lukujen keskiarvo' tmcname='osa03-Osa03_13.ListanLukujenKeskiarvo'> -->
17381739

1739-
<programming-exercise name='Average of the numbers in the list' tmcname='osa03-Osa03_13.ListanLukujenKeskiarvo'>
1740+
<programming-exercise name='Average of a list' tmcname='part03-Part03_13.AverageOfAList'>
17401741

17411742

17421743
<!-- Toteuta ohjelma, joka lukee käyttäjältä lukuja listalle. Syötteiden lukeminen päätetään kun käyttäjä syöttää luvun -1. -->
@@ -1985,7 +1986,7 @@ Second can still be found
19851986

19861987
<!-- <programming-exercise name='Löytyykö listalta' tmcname='osa03-Osa03_14.LoytyykoListalta'> -->
19871988

1988-
<programming-exercise name='Can the value be found in the list' tmcname='osa03-Osa03_14.LoytyykoListalta'>
1989+
<programming-exercise name='On the list?' tmcname='part03-Part03_14.On the list?'>
19891990

19901991

19911992

@@ -2012,7 +2013,7 @@ Mari löytyi!
20122013
**Alex**
20132014
**Mary**
20142015

2015-
Who is searched for? **Mary**
2016+
Search for? **Mary**
20162017
Mary was found!
20172018

20182019
</sample-output>
@@ -2036,7 +2037,7 @@ Leevi ei löytynyt!
20362037
**Alex**
20372038
**Mary**
20382039

2039-
Who is searched for? **Logan**
2040+
Search for? **Logan**
20402041
Logan was not found!
20412042

20422043
</sample-output>
@@ -2173,7 +2174,7 @@ printSmallerThan(list, 3);
21732174

21742175
<!-- <programming-exercise name='Tulosta rajatut' tmcname='osa03-Osa03_15.TulostaRajatut'> -->
21752176

2176-
<programming-exercise name='Print in range' tmcname='osa03-Osa03_15.TulostaRajatut'>
2177+
<programming-exercise name='Print in range' tmcname='part03-Part03_15.PrintInRange'>
21772178

21782179

21792180

@@ -2297,7 +2298,7 @@ public static double average(ArrayList<Integer> numbers) {
22972298

22982299
<!-- <programming-exercise name='Summa' tmcname='osa03-Osa03_16.Summa'> -->
22992300

2300-
<programming-exercise name='Sum' tmcname='osa03-Osa03_16.Summa'>
2301+
<programming-exercise name='Sum' tmcname='part03-Part03_16.Sum'>
23012302

23022303

23032304
<!-- Luo tehtäväpohjaan metodi `public static int summa(ArrayList<Integer> luvut)`. Metodin tulee palauttaa parametrina annetun listan lukujen summa. -->
@@ -2430,7 +2431,7 @@ System.out.println(numbers);
24302431

24312432
<!-- <programming-exercise name='Poista viimeinen' tmcname='osa03-Osa03_17.PoistaViimeinen'> -->
24322433

2433-
<programming-exercise name='Remove last' tmcname='osa03-Osa03_17.PoistaViimeinen'>
2434+
<programming-exercise name='Remove last' tmcname='part03-Part03_17.RemoveLast'>
24342435

24352436

24362437
<!-- 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

Comments
 (0)