Skip to content

Commit 36a4e02

Browse files
authored
Typos and assorted language changes
1 parent 98d0c8f commit 36a4e02

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

data/part-1/2-printing.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Hello world!
6060
6161
Tulostuskomennon avulla tulostettavaa tekstiä voi vaihtaa mielivaltaisesti, kunhan komento `System.out.println("mielivaltainen teksti");` -- eli `System` piste `out` piste `println` sulut auki `(` "teksti" sulut kiinni `)` ja puolipiste `;` pysyy muuttumattomana. Alla oleva komento tulostaa tekstin "Hei vaan!". -->
6262

63-
In this material, the text boxes like the one above demonstrate an output produced by the example code. Accordingly, the above program would produce the print output "Hello World!". You can try any of these examples in the exercise template named "Sandbox", which you will find in the programming environment.
63+
In this material, text boxes like the one above demonstrate an output produced by the example code. Accordingly, the above program would produce the print output "Hello World!". You can try any of these examples in the exercise template named "Sandbox", which you will find in the programming environment.
6464

65-
You can print any text you want with the command, as long as the command `System.out.println("arbitary text");` -- i.e., `System` dot `out` dot `println` open parenthesis `(` "the text" close parenthesis `)` and semicolon `;` remains unchanged. The command below will print the text "Hello there!".
65+
You can print any text you want with the command, as long as the command `System.out.println("arbitrary text");` -- i.e., `System` dot `out` dot `println` open parenthesis `(` "the text" close parenthesis `)` and semicolon `;` remains unchanged. The command below will print the text "Hello there!".
6666

6767
<!-- ```java
6868
System.out.println("Hei vaan!");
@@ -100,7 +100,7 @@ public class Esimerkki {
100100

101101
## Program Boilerplate
102102

103-
Our programs have to be written within a program boilerplate (the frame around the program itself), such as the one below, for them to work. The name of the boilerplate, `Example` in this case, corresponds to the name of the file that contains the source code (e.g. `Example.java`).
103+
In Java, our programs have to include some boilerplate code to function. This boilerplate, an example of which is shown below, for example tells the computer what your program is called. Below, the name of the program is `Example`. This name has to correspond to the name of the file that contains the source code (e.g. `Example.java`).
104104

105105
```java
106106
public class Example {
@@ -122,7 +122,7 @@ Tulostettava teksti
122122
123123
-->
124124

125-
Execution of the program starts from the line that follows `public static void main(string[] args) {`, and ends at the closing curly bracket `}`. Commands are executed one line at a time. We will get know the meaning of the words `public class` and `public static void` later on. In the above example, `System.out.println("Text to be printed")` is the only command to be executed and its output is:
125+
Execution of the program starts from the line that follows `public static void main(string[] args) {`, and ends at the closing curly bracket `}`. Commands are executed one line at a time. We will get to know the meaning of the words `public class` and `public static void` later on. In the above example, `System.out.println("Text to be printed")` is the only command to be executed and its output is:
126126

127127
<sample-output>
128128

@@ -159,7 +159,7 @@ The examples in the material will not always show the boilerplate, but you can a
159159
System.out.println("Hello world");
160160
```
161161

162-
In reality however, the above example written as a full Java program looks like this:
162+
In reality, the above example written as a full Java program looks like this:
163163

164164
```java
165165
public class Example {
@@ -202,14 +202,12 @@ Kun olet tehnyt tehtävän ja huomaat, että ohjelma tulostaa halutun merkkijono
202202
-->
203203

204204
You'll find the second programming exercise of the course below. If you want, you can watch the video linked below in advance to see how the exercise is solved.
205-
Here is the second programming exercise of the course. If you want, you can see first the video on how to solve this exercise:
206-
207205

208206
<youtube id="-DzOKI6iH5w"></youtube>
209207

210208
<programming-exercise name='Ada Lovelace' tmcname='part01-Part01_02.AdaLovelace'>
211209

212-
The exercise template has the following frame:
210+
The exercise template has the following boilerplate code:
213211

214212
```java
215213
public class AdaLovelace {
@@ -228,7 +226,7 @@ Ada Lovelace
228226

229227
</sample-output>
230228

231-
Once you've finished the exercise and see that it prints the correct string, return the exercise to TMC server. After that, you can read more about [Ada Lovelace](https://en.wikipedia.org/wiki/Ada_Lovelace), who was one of the first programmers.
229+
Once you've finished the exercise and have confirmed that it prints the correct string, return the exercise to TMC server. After that, you can read more about [Ada Lovelace](https://en.wikipedia.org/wiki/Ada_Lovelace), who was one of the first programmers.
232230

233231
</programming-exercise>
234232

@@ -248,13 +246,13 @@ Käytössämme oleva ohjelmointiympäristö kääntää ja suorittaa ohjelman yh
248246

249247
<text-box variant='hint' name='Running the program'>
250248

251-
You can run a program in TMC by pressing the green play-button, or by selecting "Run project" from the TMC-menu.
249+
You can run a program in TMC by pressing the green play button, or by selecting "Run project" from the TMC menu.
252250

253251
Although running the program is straightforward, a lot happens behind the scenes. When a program is run, the source code is first compiled into Java bytecode. This compilation process is done by Java's own compiler, which itself is a program. Following that, the program gets executed, meaning the commands are executed one-by-one by a Java-interpreter that is able to read Java bytecode.
254252

255-
This compile process affects how and when errors occur. When program is compiled before execution, the compiler can search errors from your program. This can also help the IDE to give tips, so the programmer can immediately notice their errors.
253+
This compiling process affects how and when errors occur. When program is compiled before execution, the compiler can search for errors in your program. This allows the IDE to give you tips, so that you may more easily correct your mistakes.
256254

257-
The IDE both compiles and executes the program with just one touch of a button. However, the programming environment compiles the program continuously, so it can report errors. You can for example try to change above Ada Lovelace exercise print command to `Systemoutprintln("hi!")` -- you will notice, that the line will be underlined and there will be notification about a error on the left side.
255+
The IDE both compiles and executes the program with just one touch of a button. However, the programming environment also compiles the program continuously, so that it can report errors. You can, for example, try to change above Ada Lovelace exercise print command to `Systemoutprintln("hi!")` -- you will notice that the line will be underlined and there will be notification about a error at the left end of the line.
258256

259257
</text-box>
260258

@@ -282,7 +280,7 @@ Hei maailma!
282280

283281
## Printing Multiple Lines
284282

285-
Programs are constructed command by command where each command comes on a new line. In the example below, command `System.out.println` appears twice, which means that two print commands are being executed in the program.
283+
Programs are constructed command by command so that each command comes on a new line. In the example below, the command `System.out.println` appears twice. This means that two print commands are being executed in the program.
286284

287285
```java
288286
public class Ohjelma {
@@ -319,9 +317,9 @@ Ohjelmoinnin opettelu onkin oikeastaan tie täynnä virheitä -- jokainen virhev
319317

320318
Programming exercises will be checked by TMC Henrik, who is very exact. Expectations about the print format in assignments are very precise. If, for example, the assignment expects you to print a parenthesis, you must obey and print the parenthesis.
321319

322-
This exactness in printing is widely relevant in programming. Missing a single character can cause an error. Beginner programmers often enter a comma instead of a dot, write for example `printin` instad of `println`, leave out apostrophes, or forget the ending semicolon after a command. Any of these would cause an error and make executing of a program fail.
320+
This exactness in printing is widely relevant in programming. Missing a single character can cause an error. Beginner programmers often enter a comma instead of a dot, write `printin` instead of `println`, leave out apostrophes, or forget the semicolon after a command. Any of these would cause an error and make the program fail to execute.
323321

324-
Learning programming really is a road full of errors -- every error message is a chance to learn. So look for any red signs in the IDE and read the test errors!
322+
Learning programming really is a road full of errors, with every error message a chance to learn. So look for any red signs in the IDE and read the test errors!
325323

326324
</text-box>
327325

@@ -364,7 +362,7 @@ public class OnceUponATime {
364362
}
365363
```
366364

367-
Edit the program so that it will print the following text. Use three `System.out.println`-commands for printing.
365+
Edit the program so that it will print the following text. Use three `System.out.println` commands for printing.
368366

369367
<sample-output>
370368

@@ -388,9 +386,9 @@ Alla oleva animaatio kuvaa sout-komennon käyttöä. Kun käyttäjä on kirjoitt
388386

389387
<text-box variant='hint' name='"sout"'>
390388

391-
Writing the command `System.out.println("...") can be pretty cumbersome. In NetBeans try to write on a blank line (in main) **sout** and press tabulator (key left to q). What happens? This small tool will propably save much of your time.
389+
Writing the command `System.out.println("...")` can be pretty cumbersome. In NetBeans, write on a blank line (in main) **sout** and press tabulator (key to the left of q). What happens? This small tool will propably save much of your time.
392390

393-
Animation below illustrates the use of sout-command. First user writes sout and then pressed tabulator. A Magic Trick!
391+
The animation below illustrates the use of sout-command. First, the user writes sout and then presses the tabulator. A Magic Trick!
394392

395393
![](../img/part1.2-sout.gif)
396394

@@ -492,7 +490,7 @@ world
492490

493491
</sample-output>
494492

495-
Although the previous example works, it's important to be considerate of other programmers (and future you!) and to use line breaks. That way, anyone reading the program knows that each line does only a single concrete thing.
493+
Although the previous example works, it's important to be considerate of other programmers (and your future self!) and to use line breaks. That way, anyone reading the program knows that each line does only a single concrete thing.
496494

497495
<!-- TODO: quiz, jossa kysytään että mistä tietyssä termissä on kyse -->
498496

0 commit comments

Comments
 (0)