Skip to content

Commit 6acef22

Browse files
committed
small fixes while translating exercises
1 parent 267044b commit 6acef22

3 files changed

Lines changed: 20 additions & 26 deletions

File tree

data/osa-2/2-toistaminen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ Write a number that asks user for input until the user inputs 0.
818818
After this, the program prints the average of the positive numbers (numbers that are greater than zero).
819819

820820
<!-- Mikäli ohjelmassa ei syötetä yhtäkään positiivista lukua, ohjelman tulee tulostaa "keskiarvon laskeminen ei ole mahdollista". -->
821-
If no positive number is inputted, the program prints "The computation of average is impossible"
821+
If no positive number is inputted, the program prints "Cannot calculate the average"
822822

823823
<!-- Alla on muutamia esimerkkejä ohjelman toiminnasta. -->
824824
Below a few examples of the programs output

data/osa-2/3-more-loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ for (int i = start; i < end; i++) {
122122
We will continue practicing loops in the following exercises. You can use either a while-loop with a condition, or a for-loop.
123123

124124

125-
<programming-exercise name='From zero to something' tmcname='part02-Part02_14.FromZeroToSomething'>
125+
<programming-exercise name='Counting' tmcname='part02-Part02_14.Counting'>
126126

127127
<!-- Kirjoita ohjelma, joka lukee käyttäjältä kokonaisluvun. Tämän jälkeen ohjelma tulostaa luvut nollasta käyttäjän syöttämään lukuun. Voit olettaa, että käyttäjä syöttää aina positiivisen luvun. Alla on muutamia esimerkkejä ohjelman toivotusta toiminnasta. -->
128128
Write a program that reads an integer from the user. Then the program prints numbers from 0 to the number given by the user. You can assume that the user always gives a positive number. Below is some examples of the wanted functionality.
@@ -477,7 +477,7 @@ Sample output:
477477
<!-- Summa on 12 -->
478478
First number? **3**
479479
Last number? **5**
480-
The sum is: 12
480+
The sum is 12
481481

482482
</sample-output>
483483

data/osa-2/4-metodit.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,13 @@ Alussa olivat suo, kuokka ja Java.
320320

321321
How many times?
322322
**7**
323-
In a hole in the ground there lived a method.
324-
In a hole in the ground there lived a method.
325-
In a hole in the ground there lived a method.
326-
In a hole in the ground there lived a method.
327-
In a hole in the ground there lived a method.
328-
In a hole in the ground there lived a method.
329-
In a hole in the ground there lived a method.
323+
In a hole in the ground there lived a method
324+
In a hole in the ground there lived a method
325+
In a hole in the ground there lived a method
326+
In a hole in the ground there lived a method
327+
In a hole in the ground there lived a method
328+
In a hole in the ground there lived a method
329+
In a hole in the ground there lived a method
330330

331331
</sample-output>
332332

@@ -547,12 +547,12 @@ public static void main(String[] args) {
547547

548548
<!-- Luo tehtäväpohjaan metodi `public static void tulostaLuvustaYhteen(int luku)`, joka tulostaa luvut parametrina annetusta luvusta yhteen asti. Alla on kaksi esimerkkiä metodin käytöstä. -->
549549

550-
Create the following method in the exercise template: `public static void printFromParameterToOne(int number)`. It should print the numbers from the number passed as a parameter down to one. Two examples of the method's usage are given below.
550+
Create the following method in the exercise template: `public static void printFromNumberToOne(int number)`. It should print the numbers from the number passed as a parameter down to one. Two examples of the method's usage are given below.
551551

552552

553553
```java
554554
public static void main(String[] args) {
555-
printFromParameterToOne(5);
555+
printFromNumberToOne(5);
556556
}
557557
```
558558

@@ -577,7 +577,7 @@ public static void main(String[] args) {
577577
```java
578578

579579
public static void main(String[] args) {
580-
printFromParameterToOne(2);
580+
printFromNumberToOne(2);
581581
}
582582

583583
```
@@ -1552,7 +1552,7 @@ public static void main(String[] args) {
15521552

15531553
```java
15541554
public static int greatest(int number1, int number2, int number3) {
1555-
// write your code here
1555+
// write some code here
15561556
}
15571557

15581558
public static void main(String[] args) {
@@ -1620,8 +1620,8 @@ public static double average(int number1, int number2, int number3, int number4)
16201620
}
16211621

16221622
public static void main(String[] args) {
1623-
double answer = average(4, 3, 6, 1);
1624-
System.out.println("Average: " + answer);
1623+
double result = average(4, 3, 6, 1);
1624+
System.out.println("Average: " + result);
16251625
}
16261626
```
16271627

@@ -2074,7 +2074,7 @@ Below is a visualization of the method call `multiplicationTable(3)`. Notice how
20742074

20752075
<!-- <programming-exercise name='Tulostelua (4 osaa)' tmcname='osa02-Osa02_33.Tulostelua'> -->
20762076

2077-
<programming-exercise name='Star sign (4 parts)' tmcname='part02-Part02_33.Star sign'>
2077+
<programming-exercise name='Star sign (4 parts)' tmcname='part02-Part02_33.StarSign'>
20782078

20792079

20802080

@@ -2107,7 +2107,7 @@ public static void main(String[] args) {
21072107

21082108
```java
21092109
public static void printStars(int number) {
2110-
// one start can be printed with the command
2110+
// you can print one star with the command
21112111
// System.out.print("*");
21122112
// call the print command n times
21132113
// in the end print a line break with the comand
@@ -2141,15 +2141,13 @@ The output of the program:
21412141

21422142
<!-- Tee metodi `tulostaNelio(int sivunpituus)` joka tulostaa neliön käyttäen `tulostaTahtia`-metodia. Siis esimerkiksi kutsu `tulostaNelio(4)` tulostaa seuraavaa: -->
21432143

2144-
Define a method called `printSquare(int lengthOfSide)` that prints a suitable square with the help of the `printStars` method. So the method call `printSquare(4)` results in the following output:
2144+
Define a method called `printSquare(int size)` that prints a suitable square with the help of the `printStars` method. So the method call `printSquare(4)` results in the following output:
21452145

21462146
<sample-output>
2147-
21482147
****
21492148
****
21502149
****
21512150
****
2152-
21532151
</sample-output>
21542152

21552153
<!-- **Huom:** tehtävässä ei riitä että tulostus näyttää oikealta, tulostaNelio-metodin sisällä neliön "rivien" tulostus tulee tehdä tulostaTahtia-metodia käyttäen. -->
@@ -2167,14 +2165,12 @@ When creating the program, you might benefit from the test code in the main to e
21672165

21682166
<!-- Tee metodi `tulostaSuorakulmio(int leveys, int korkeus)` joka tulostaa suorakulmion käyttäen `tulostaTahtia`-metodia. Siis esimerkiksi kutsu `tulostaSuorakulmio(17,3)` tulostaa seuraavaa: -->
21692167

2170-
Write a method called `printRectangle(int width, int height`) that prints the correct rectangle by using the `printStars` method. So the method call `printRectangle(17, 3)` should produce the following output:
2168+
Write a method called `printRectangle(int width, int height)` that prints the correct rectangle by using the `printStars` method. So the method call `printRectangle(17, 3)` should produce the following output:
21712169

21722170
<sample-output>
2173-
21742171
*****************
21752172
*****************
21762173
*****************
2177-
21782174
</sample-output>
21792175

21802176

@@ -2187,12 +2183,10 @@ Write a method called `printRectangle(int width, int height`) that prints the co
21872183
Create a method called `printTriangle(int size)` that prints a triangle by using the `printStars` method. So the call `printTriangle(4)` should print the following:
21882184

21892185
<sample-output>
2190-
21912186
*
21922187
**
21932188
***
21942189
****
2195-
21962190
</sample-output>
21972191

21982192
</programming-exercise>

0 commit comments

Comments
 (0)