List of Exercises

Table 2. Exercises in 113105 Software development 1
Chapter Exercise
No. Title Status of completion
Getting started 1 Extending class HelloWorld
2 Working with variables
3 A conditional
4 A loop
Language Fundamentals 5 Hotel key cards
6 Literal samples
7 Literals of type int
8 Integer overflow
9 Strange sum result
10 Correcting the error
11 Legal variable names
12 Benefits of final
13 «C» vs. Java.
14 Assignment and type safety
15 Inventing tinyint.
16 An int's minimum and maximum value
17 Pretty may not be pretty
18 Strange output
19 Poor mans ASCII table
20 Integer value hexadecimal representation
21 Binary literals
22 Testing the limits (Difficult)
23 Why using braces in System.out.println(...) ?
24 Composing strings of literals and variables
25 Escaping double quotes
26 Supplementary string exercises
27 int and char
28 float vs. double
29 int to char narrowing problems
30 Get a byte from 139
31 Ariane, I miss you!
32 Reducing long to int (difficult)
33 Calculating a circle's area
34 Dividing values
35 Strange things with operator ++
36 Adding values
37 Representational float and double miracles
38 Expressions involving infinity
39 int to short assignment
40 int to short assignment using final
41 Calculating a circle's area avoiding accidental redefinition
42 Turning weeks into seconds
43 Turning seconds into weeks
44 Using predefined Java™ standard library constants
45 Converting temperature values
46 Time unit conversion
47 Interest calculation
48 Summing short and char
49 Operator & vs. &&
50 Strange addition
51 Understanding +=
52 Three ways expressing the same
53 Guessing results
54 Cleaning up the mess
Statements 55 Providing better display
56 Comparing for equality
57 Replacing else if (...){...} by nested if ... else statements
58 Post modifying an exam's marking
59 At the bar
60 Roman numerals
61 Leap years
62 Why break?
63 Extending to month days
64 Converting day's names to numbers.
65 Day categories.
66 Roman numerals, using switch
67 Generating square numbers
68 Calculating factorial
69 Even or odd?
70 Square root approximation
71 Printing numbers
72 Printing just even numbers
73 Merry Xmas
74 More fun with Xmas trees
75 A basic square number table
76 Tidy up the mess!
77 HTML-ify me
78 Auxiliary Example, part 1: A multiplication table
79 Auxiliary Example, part 2: Avoiding redundant entries
80 Creating a real square table
81 Creating a sophisticated HTML version of your square table
82 Display all summands
83 Playing lottery
84 Guessing numbers
85 Smallest multiple
86 Smallest multiple, purely algebraic solution
87 Pythagorean triples
88 Avoiding duplicates and gaining performance
Objects and Classes 89 Compile time error
90 An Address class
91 Understanding access control
92 Explaining times
93 Implementing getter methods
94 Method signature variants
95 Will a match be found?
96 Modeling geometry objects: Rectangles
97 Modeling circles
98 Adding translations and SVG export.
99 Extending the employee example.
100 Refining access to an employee's attributes
101 File system representation
102 Your personal String class
103 Constructors variable names and this.
104 Class vs. instance
105 Distinguishing leap- and non-leap years
106 A method for printing square numbers using for, while and do ... while
107 Nicely formatting sine values.
108 Extending our interest calculator
109 Integer value considerations.
110 Programmer's favourite expression
111 Lotteries revisited
112 Finding the greatest common divisor of two integer values
113 Dealing with IBAN numbers
114 Cancelling fractions
115 Dealing with local Maven dependencies
116 DNS inflicted groupId / package names clashes
117 Details on execution
118 Maximum and absolute value
119 Factorial, the direct way
120 Factorial, the recursive way
121 Binomials, the recursive way
122 The exponential f x = e x
123 Implementing sin ( x ) .
124 Summing up in a different order.
125 Summing up integers to a given limit
126 Summing up, the better way
127 Turning seconds into weeks, part 2
128 Example: A class representing fractions
129 Compass directions
130 Compass direction neighbours
131 Former zodiac examination task
132 git local, DIY
133 git distributed, DIY
Core Classes 134 Choosing a good hashCode() method
135 String and good hashCode() implementations.
136 Common pitfall using trigonometric functions
137 Using constants from java.lang.Math.
138 Strings on CodingBat
139 Masking strings
140 Analyzing strings
141 Pitfalls using ==: Equality of String instances
142 Weird, weirder, weirdest!
143 Analyzing file pathnames
Arrays 144 Assignment to final variable?
145 Converting string arrays to HTML.
146 Route navigation
147 Examinations and mark frequencies
148 Pangram checker
149 Reconsidering System.out.format().
150 Understanding search results
151 Implementing append directly
152 Purge duplicates
153 A container of fixed capacity holding integer values
154 Allow for variable capacity holding integer values
155 Reading console input
156 Prettifying output representation
157 2-dimensional arrays and .length
158 External array and string exercises
159 Tic-tac-toe using a two-dimensional array
160 Changing the game's internal representation
161 Tic-tac-toe, Computer vs. human
162 Adding support to retrieve statistical data.
163 Testing an implementation
164 Improving prime number calculation performance
165 Calculating the median
166 A simple character based plotting application
Inheritance 167 Let me pass, please!
168 Why is == correctly comparing enum instances?
169 String vs. StringBuffer
170 Alternate implementation of opposite directions
171 Defining a Shape class hierarchy
172 Scaling shapes
173 Providing toString() methods
174 protected vs. package private
175 protected access involving different instances
Error Handling 176 Mind your prey
177 Expected exception test failure
Working with Numbers 178 Auto boxing int to Double?
179 Why using String userInput = null?
180 Parsing short values
181 Parsing short values in hexadecimal representation
182 Locale definitions
183 Formatting int, double and LocaleDate
184 Chaining subtract method calls
interface definitions and abstract Classes 185 Understanding Arrays.sort()
186 Sorting Rectangle instances by width
187 Sorting Rectangle instances by width and height
188 Adding flexibility in sorting rectangles
189 A nonsense generator
190 An interface based plotter
Application deployment I 191 Various integer array algorithms
192 A command line version computing a sample's average and median
Reading character streams 193 Adding line numbers to text files
194 A partial implementation of GNU UNIX wc
Collections 195 Inserting strings into a Set.
196 Inserting strings into a List.
197 Representing integer coordinate values
198 Inserting Coordinate instances into a Set.
199 Getting a text's set of words.
200 A text's set of words in alphabetic order
201 Implementing unusual string sorting.
202 Words and corresponding frequencies
203 Formatting an address list
204 Implementing a set of strings
205 Implementing word frequencies by Map<String, Integer> instances.
206 Regain sorting capabilities.
207 Creating an overview of grades showing frequencies
208 Creating an overview of grades showing individual names