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