From f46f5efd829f874966e868a4f20f2d665d401d64 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Tue, 4 Aug 2026 00:27:41 +0300
Subject: [PATCH 1/4] add listing tags
---
source/ch8_filehandling.ptx | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/source/ch8_filehandling.ptx b/source/ch8_filehandling.ptx
index ba5d0cf..5399ecd 100644
--- a/source/ch8_filehandling.ptx
+++ b/source/ch8_filehandling.ptx
@@ -75,8 +75,8 @@
We will now create a File object. It is important to create a meaningful name for the File object. We will call ours myFile, and we will call our class CreateFileObject.
-
-
+
+
import java.io.File;
@@ -90,6 +90,7 @@ public class CreateFile {
}
+
@@ -105,8 +106,8 @@ public class CreateFile {
First, lets look at the equivalent Python code:
-
-
+
+
filename = "newfile.txt"
print("Attempting to write to '" + filename + "' using 'w' mode...")
@@ -120,12 +121,13 @@ public class CreateFile {
+
Now, let's look at Java code that accomplishes the same task:
-
-
+
+
import java.io.File;
import java.io.IOException;
@@ -148,6 +150,7 @@ public class CreateFile {
}
+
From 82168dbff673f1c606a078604862ba0abafc760d Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Tue, 4 Aug 2026 00:32:07 +0300
Subject: [PATCH 2/4] fixed a broken code
---
source/ch7_recursion.ptx | 1 +
1 file changed, 1 insertion(+)
diff --git a/source/ch7_recursion.ptx b/source/ch7_recursion.ptx
index 5f1da65..f04f71c 100644
--- a/source/ch7_recursion.ptx
+++ b/source/ch7_recursion.ptx
@@ -238,6 +238,7 @@ def main():
main()
+
separation of concerns
The key insight here is called the separation of concerns. The public sum_array method provides a user-friendly interface—callers just pass an array and get the sum. Users don't need to know about indexes or how the recursion works internally. The private _sum_helper method handles the recursive logic with the extra parameter needed to track progress through the array.
From 92c752881cd7ffda8fb79fd5f76759c8e12fc07b Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Tue, 4 Aug 2026 00:32:23 +0300
Subject: [PATCH 3/4] add listing in text
---
source/ch8_filehandling.ptx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source/ch8_filehandling.ptx b/source/ch8_filehandling.ptx
index 5399ecd..e1b654d 100644
--- a/source/ch8_filehandling.ptx
+++ b/source/ch8_filehandling.ptx
@@ -73,7 +73,7 @@
- We will now create a File object. It is important to create a meaningful name for the File object. We will call ours myFile, and we will call our class CreateFileObject.
+ We will now create a File object. It is important to create a meaningful name for the File object. We will call ours myFile, and we will call our class CreateFileObject. shows the code to create a File object in Java.
@@ -104,7 +104,7 @@ public class CreateFile {
- First, lets look at the equivalent Python code:
+ shows the equivalent code to create a file in Python.
@@ -124,7 +124,7 @@ public class CreateFile {
- Now, let's look at Java code that accomplishes the same task:
+ shows the equivalent code to create a file in Java.
From b2ca8bc3d153299592bf50600c754dab0a627913 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Tue, 4 Aug 2026 00:35:11 +0300
Subject: [PATCH 4/4] fixed a code
---
source/ch8_filehandling.ptx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source/ch8_filehandling.ptx b/source/ch8_filehandling.ptx
index e1b654d..542ebfb 100644
--- a/source/ch8_filehandling.ptx
+++ b/source/ch8_filehandling.ptx
@@ -73,7 +73,7 @@
- We will now create a File object. It is important to create a meaningful name for the File object. We will call ours myFile, and we will call our class CreateFileObject. shows the code to create a File object in Java.
+ We will now create a File object. It is important to create a meaningful name for the File object. We will call ours myFile, and we will call our class CreateFileObject. shows the code to create a File object in Java.
@@ -104,7 +104,7 @@ public class CreateFile {
- shows the equivalent code to create a file in Python.
+ shows the equivalent code to create a file in Python.
@@ -124,7 +124,7 @@ public class CreateFile {
- shows the equivalent code to create a file in Java.
+ shows the equivalent code to create a file in Java.