Skip to content

Commit 5d3dfe4

Browse files
committed
fix Boolean vs boolean
1 parent 7ae8b3f commit 5d3dfe4

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

source/ch4_conditionals.ptx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ The <c>switch</c> statement is not used very often, and we recommend you do not
389389
<section xml:id="boolean-operators">
390390
<title>Boolean Operators</title>
391391

392-
<p><idx>boolean operators</idx> <idx>simple comparisons</idx> <idx>compound boolean expressions</idx>
393-
The conditionals used in the if statement can be <term>boolean variables</term>, <term>simple comparisons</term>, and <term>compound boolean expressions</term>.
392+
<p><idx>Boolean operators</idx> <idx>simple comparisons</idx> <idx>compound Boolean expressions</idx>
393+
The conditionals used in the if statement can be <term>Boolean variables</term>, <term>simple comparisons</term>, and <term>compound Boolean expressions</term>.
394394
</p>
395395

396396
<p><idx>ternary operator</idx>
@@ -408,7 +408,7 @@ of an assignment statement. The following table summarizes how this works:
408408
</row>
409409
<row>
410410
<cell><c>condition</c></cell>
411-
<cell>The Boolean expression that is evaluated (e.g., <c>a % 2 == 0</c>).</cell>
411+
<cell>The <c>boolean</c> expression that is evaluated (e.g., <c>a % 2 == 0</c>).</cell>
412412
</row>
413413
<row>
414414
<cell><c>?</c></cell>

source/ch5_loopsanditeration.ptx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public class StringIterationExample {
173173
<title>Indefinite Loops</title>
174174

175175
<p><idx><c>while</c> loop</idx>
176-
Both Python and Java support the <idx><c>while</c></idx> loop, which continues to execute as long as a condition is true.
176+
Both Python and Java support the <c>while</c> loop, which continues to execute as long as a condition is true.
177177
Here is a simple example in Python that counts down from 5:
178178
</p>
179179
<program interactive="activecode" language="python">

source/ch8_filehandling.ptx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
</note>
113113

114114
<p>
115-
Now that we have created a new <c>File</c> object, we can create a file using the <c>createNewFile()</c> method from the <c>File</c> class. While the previous line of code creates an object within the program for the file, this method actually does the work of creating a file and saving it in the current working directory. This method returns a boolean value. If the method returns <c>true</c>, the file was successfully created. If the method returns <c>false</c>, there is already a file using the chosen file name. We can use this method's possible return values in tandem with an try/catch structure to determine if the file was created, or catch the error if a file with that file name already exists in the directory.
115+
Now that we have created a new <c>File</c> object, we can create a file using the <c>createNewFile()</c> method from the <c>File</c> class. While the previous line of code creates an object within the program for the file, this method actually does the work of creating a file and saving it in the current working directory. This method returns a <c>boolean</c> value. If the method returns <c>true</c>, the file was successfully created. If the method returns <c>false</c>, there is already a file using the chosen file name. We can use this method's possible return values in tandem with an try/catch structure to determine if the file was created, or catch the error if a file with that file name already exists in the directory.
116116
</p>
117117

118118
<p>
@@ -541,15 +541,15 @@
541541
</note>
542542

543543
<p>
544-
Speaking of overwriting data, what if we want to append text to the end of any text already in <c>myfile.txt</c>? To accomplish this, we can pass a boolean argument along with the file name when creating a new data argument:
544+
Speaking of overwriting data, what if we want to append text to the end of any text already in <c>myfile.txt</c>? To accomplish this, we can pass a <c>boolean</c> argument along with the file name when creating a new data argument:
545545
</p>
546546

547547
<pre>
548548
FileWriter myWriter = new FileWriter("myfile.txt", true); // true enables append mode
549549
</pre>
550550

551551
<p>
552-
Now, when we use <c>write()</c> method like before, the text will be appended if there is already text in the document. If we were to update our code to include the boolean argument:
552+
Now, when we use <c>write()</c> method like before, the text will be appended if there is already text in the document. If we were to update our code to include the <c>boolean</c> argument:
553553
</p>
554554
<datafile label="my-file-8-4-6" filename="myfile.txt" xml:id= "my-file-8-4-6" editable="yes">
555555
<pre>

0 commit comments

Comments
 (0)