Groundwork—downloadable examples
ch01-your-first-programs
- ch01_01.java: Hello, world!
- ch01_02.java:
- ch01_03.java: First line
- ch01_04.java: HydrogenHeliumLithium
- ch01_05.java:
- ch01_06.java: 7
- ch01_07.java: Total: 5.75
- ch01_08.java: 42.1558
- ch01_09.java: fails on purpose: A missing closing quote. The error message is the lesson.
- ch01_10.java:
- ch01_12.java:
- ch01_13.java: predict what it prints
- ch01_14.java: ===== CORNER STORE =====
ch02-variables-and-types
- ch02_01.java: Ada scored 42
- ch02_02.java: 6
- ch02_03.java: 8 3
- ch02_04.java: 7
- ch02_05.java: 14
- ch02_06.java: fails on purpose: A String put into an int variable. The error message is the lesson.
- ch02_07.java:
- ch02_08.java: waits for typed input
- ch02_09.java: waits for typed input
- ch02_10.java: waits for typed input
- ch02_11.java: 3
- ch02_12.java: waits for typed input
- ch02_13.java:
- ch02_16.java: predict what it prints
- ch02_17.java: fails on purpose: This program divides a String by a number, which javac refuses. Fixing it is the exercise.
- ch02_18.java: waits for typed input
ch03-expressions-and-operators
- ch03_01.java: 0
- ch03_02.java: 3
- ch03_03.java: -1141367296
- ch03_04.java: 16
- ch03_05.java: 0.30000000000000004
- ch03_06.java: 3
- ch03_07.java: Ada scored 91.5 points.
- ch03_08.java: Total: $7.50
- ch03_09.java: A 7 by 4 rectangle has area 28.
- ch03_10.java: Ada Lovelace
- ch03_11.java: waits for typed input
- ch03_12.java: true
- ch03_13.java: true
- ch03_14.java: fails on purpose: A range written the way it is on paper, which Java refuses. The error message is the lesson.
- ch03_15.java: 65
- ch03_19.java: predict what it prints
- ch03_21.java: waits for typed input
ch04-making-decisions
- ch04_01.java: It is hot out.
- ch04_02.java:
- ch04_03.java: Congratulations.
- ch04_04.java: waits for typed input
- ch04_05.java: waits for typed input
- ch04_06.java: D
- ch04_07.java: Enjoy the show.
- ch04_08.java: Enjoy the show.
- ch04_09.java: fails on purpose: A String used as a condition, which javac refuses. The error message is the lesson.
- ch04_10.java: waits for typed input
- ch04_11.java: waits for typed input
- ch04_12.java: waits for typed input
- ch04_17.java: predict what it prints
- ch04_19.java: waits for typed input
ch05-repetition
- ch05_01.java: Count is 1
- ch05_02.java: waits for typed input
- ch05_03.java: i is 0
- ch05_04.java: Countdown:
- ch05_05.java: 1 x 1 = 1
- ch05_06.java: 1 2 3 4
- ch05_07.java: J
- ch05_08.java: There is an a at position 1.
- ch05_09.java: The numbers 1 to 100 add up to 5050.
- ch05_10.java: There are 25 even numbers from 1 to 50.
- ch05_11.java: waits for typed input
- ch05_12.java: #
- ch05_13.java: waits for typed input
- ch05_14.java: 3
- ch05_21.java: predict what it prints
- ch05_22.java: waits for typed input
ch06-methods
- ch06_01.java: Hello!
- ch06_02.java: Hello, Ada!
- ch06_03.java: A 7 by 4 rectangle has area 28.
- ch06_04.java: Hello, Ada!
- ch06_05.java: The room is 120 square feet.
- ch06_06.java: 10
- ch06_07.java: fails on purpose: A void method's result stored in a variable, which javac refuses. The error message is the lesson.
- ch06_08.java: 2
- ch06_09.java: 5.0
- ch06_10.java: 8 minutes and 20 seconds
- ch06_11.java: fails on purpose: A variable used outside the method that created it, which javac refuses. The error message is the lesson.
- ch06_12.java: 54.0
- ch06_13.java: 54.0
- ch06_14.java: 8 minutes and 20 seconds
- ch06_15.java: 212.0
- ch06_16.java: 7
- ch06_22.java: predict what it prints
- ch06_23.java: waits for typed input
ch07-arrays-and-lists
- ch07_01.java: [88, 92, 79, 95]
- ch07_02.java: fails on purpose: An int array given a String, which javac refuses. The error message is the lesson.
- ch07_03.java: Ada
- ch07_04.java: fails on purpose: Java has no negative indexes, so index -1 does not exist and the program stops. The exception is the lesson.
- ch07_05.java: fails on purpose: The array has two items, so index 5 does not exist and the program stops. The exception is the lesson.
- ch07_06.java: [88, 92, 85, 95]
- ch07_07.java: [b, c, d]
- ch07_08.java: Score: 88
- ch07_09.java: 1. Ada
- ch07_10.java: 4
- ch07_11.java: [1, 2, 3]
- ch07_12.java: [88, 92, 79, 95]
- ch07_13.java: [1, 9]
- ch07_14.java: [88, 92, 79, 95]
- ch07_15.java: [Ada, Grace, Alan, Katherine, Edsger]
- ch07_16.java: 1
- ch07_17.java: fails on purpose: What Collections.sort gives back is stored in a variable, which javac refuses: it gives back nothing. The error message is the lesson.
- ch07_18.java: [79, 88, 92] [88, 92, 79]
- ch07_19.java: [32.0, 77.0, 212.0, 98.6]
- ch07_20.java: 4 of 6 passed: [88, 92, 95, 71]
- ch07_21.java: [1, 2, 3, 4]
- ch07_22.java: true
- ch07_30.java: Student Score Grade
ch08-strings-as-data
- ch08_01.java: 4
- ch08_02.java: fails on purpose: One character of a String is assigned to, which javac refuses: a String cannot be changed. The error message is the lesson.
- ch08_03.java: java
- ch08_04.java: ABC
- ch08_05.java: [ada lovelace]
- ch08_06.java: false
- ch08_07.java: true
- ch08_08.java: [the, quick, brown, fox]
- ch08_09.java: [, the, quick, , brown, fox]
- ch08_10.java: []
- ch08_11.java: the quick brown fox
- ch08_12.java: 88, 92, 79
- ch08_13.java: 6
- ch08_14.java: Prgrmmng n Jv
- ch08_15.java: 9 letters, 4 digits, 4 others
- ch08_16.java: 121
- ch08_17.java: true racecar
- ch08_18.java: Name: Ada
- ch08_19.java: 1. Add a student
- ch08_27.java: ==================================
ch09-maps-and-sets
- ch09_01.java: 92
- ch09_02.java: {Ada=91, Grace=92, Alan=45}
- ch09_03.java: null
- ch09_04.java: No score recorded.
- ch09_05.java: Ada
- ch09_06.java: Ada scored 88
- ch09_07.java: 225
- ch09_08.java: Grace has the highest score: 92
- ch09_09.java: {Ada=88, Grace=92, Alan=45, Katherine=95, Edsger=71}
- ch09_10.java: 3
- ch09_11.java: the 3
- ch09_12.java: 88
- ch09_13.java: true
- ch09_14.java: [Ada, Katherine, Alan, Grace]
- ch09_15.java: [Ada, Grace, Alan, Katherine]
- ch09_23.java: Option Votes Share Chart
ch10-records
- ch10_01.java: 3
- ch10_02.java: fails on purpose: A record's component is assigned to, which javac refuses: a record cannot be changed. The error message is the lesson.
- ch10_03.java: true
- ch10_04.java: O
- ch10_05.java: x is 3, y is 4
- ch10_06.java: Range[lowest=1, highest=9]
- ch10_07.java: Ada: 88
- ch10_08.java: Ada
- ch10_09.java: [88, 92, 45, 95]
- ch10_10.java: Katherine 95
- ch10_11.java: Grace is in grade 10.
- ch10_12.java: Grade 9: Ada, Alan
- ch10_20.java: Item Category Price Qty Value
ch11-searching-and-sorting
- ch11_01.java: 4
- ch11_02.java: 6
- ch11_03.java: Step 1: checking index 24 (value 48), 50 items still in range
- ch11_04.java: [11, 12, 22, 25, 64]
- ch11_05.java: Pass 1: [11] [25, 12, 22, 64]
- ch11_06.java: [11, 12, 22, 25, 64]
- ch11_07.java: [11, 12, 22, 25, 64]
- ch11_15.java: SEARCHING for a missing value
ch12-recursion-and-problem-solving
- ch12_01.java: 120
- ch12_02.java: fails on purpose: This recursion never reaches its base case, so it calls itself until Java runs out of room and stops the program. It crashes on purpose: the error is the lesson.
- ch12_03.java: factorial(4) called
- ch12_04.java: 15
- ch12_05.java: noisrucer
- ch12_06.java: 3
- ch12_07.java: 0 1 1 2 3 5 8 13 21 34
- ch12_08.java: 12586269025
- ch12_09.java: 12586269025
- ch12_10.java: 5
- ch12_18.java: # ID Name Gr Avg Grade