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 Renaming a class file
3 Editing and compilation
4 Editing bytecode
5 Working with variables
6 Code equivalence
7 Different byte code, same execution results
8 A conditional
9 A loop
10 Getting used to Intellij IDEA
Language Fundamentals 11 Hotel key cards
12 Legal variable names
13 Benefits of final
14 «C» vs. Java.
15 Assignment and type safety
16 Inventing tinyint.
17 An int's minimum and maximum value
18 Pretty may not be pretty
19 Strange output
20 Representing emoticons.
21 Poor mans ASCII table
22 Integer value hexadecimal representation
23 Binary literals
24 Testing the limits (Difficult)
25 Why using braces in System.out.println(...) ?
26 Composing strings of literals and variables
27 Escaping double quotes
28 Supplementary string exercises
29 int and char
30 float vs. double
31 int to char narrowing problems
32 Get a byte from 139
33 Ariane, I miss you!
34 Reducing long to int (difficult)
35 Calculating a circle's area
36 Dividing values
37 Strange things happen
38 Adding values
39 Representational float and double miracles
40 Expressions involving infinity
41 int to short assignment
42 int to short assignment using final
43 Calculating a circle's area avoiding accidental redefinition
44 Turning weeks into seconds
45 Turning seconds into weeks
46 Using predefined Java™ standard library constants
47 Converting temperature values
48 Time unit conversion
49 Interest calculation
50 Summing short and char
51 Operator & vs. &&
52 Understanding +=
53 Three ways expressing the same
54 Guessing results
55 Cleaning up the mess
Statements 56 Providing better display
57 Comparing for equality
58 Replacing else if (...){...} by nested if ... else statements
59 Post modifying an exam's marking
60 At the bar
61 Roman numerals
62 Leap years
63 Why break?
64 Extending to month days
65 Converting day's names to numbers.
66 Day categories.
67 Roman numerals, using switch
68 Generating square numbers
69 Calculating factorial
70 Even or odd?
71 Square root approximation
72 Printing 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 Static code analysis
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 Details on execution
114 Cancelling fractions
115 Dealing with local Maven dependencies
116 Maximum and absolute value
117 Factorial, the direct way
118 Factorial, the recursive way
119 Binomials, the recursive way
120 The exponential f x = e x
121 Implementing sin ( x ) .
122 Summing up in a different order.
123 Transforming arguments.
124 Summing up integers to a given limit
125 Summing up, the better way
126 Turning seconds into weeks, part 2
127 Example: A class representing fractions
128 Compass directions
129 Compass direction neighbours
130 git local, DIY
131 git distributed, DIY
Core Classes 132 Choosing a good hashCode() method
133 String and good hashCode() implementations.
134 Common pitfall using trigonometric functions
135 Using constants from java.lang.Math.
136 Strings on CodingBat
137 Masking strings
138 Analyzing strings
139 Pitfalls using ==: Equality of String instances
140 Weird, weirder, weirdest!
141 Analyzing file pathnames
Arrays 142 Assignment to final variable?
143 Converting string arrays to HTML.
144 Route navigation
145 Examinations and mark frequencies
146 Pangram checker
147 Reconsidering System.out.format().
148 Understanding search results
149 Implementing append directly
150 Purge duplicates
151 A container of fixed capacity holding integer values
152 Allow for variable capacity holding integer values
153 Reading console input
154 Prettifying output representation
155 2-dimensional arrays and .length
156 External array and string exercises
157 Tic-tac-toe using a two-dimensional array
158 Changing the game's internal representation
159 Tic-tac-toe, Computer vs. human
160 Adding support to retrieve statistical data.
161 Testing an implementation
162 Improving prime number calculation performance
163 Calculating the median
164 A simple character based plotting application
Inheritance 165 Let me in, please!
166 Why does == work for enum instances?
167 String vs. StringBuffer
168 Alternate implementation of opposite directions
169 Defining a Shape class hierarchy
170 Scaling shapes
171 Providing toString() methods
172 protected vs. package private
173 protected access involving different instances
174 Why is oRectangle = (Rectangle) o a legal cast?
Error Handling 175 Mind your prey
176 Expected exception test failure
Working with Numbers 177 Auto boxing int to Double?
178 Why using String userInput = null?
179 Parsing short values
180 Parsing short values in hexadecimal representation
181 Locale definitions
182 Formatting int, double and LocaleDate
183 Chaining subtract method calls
interface definitions and abstract Classes 184 Understanding Arrays.sort()
185 Sorting Rectangle instances by width
186 Sorting Rectangle instances by width and height
187 Adding flexibility in sorting rectangles
188 A nonsense generator
189 An interface based plotter
Application deployment I 190 Various integer array algorithms
191 A command line version computing a sample's average and median
Reading character streams 192 Adding line numbers to text files
193 A partial implementation of GNU UNIX wc
Collections 194 Inserting strings into a Set.
195 Inserting strings into a List.
196 Representing integer coordinate values
197 Inserting Coordinate instances into a Set.
198 Getting a text's set of words.
199 A text's set of words in alphabetic order
200 Implementing unusual string sorting.
201 Words and corresponding frequencies
202 Formatting an address list
203 Implementing a set of strings
204 Implementing word frequencies by Map<String, Integer> instances.
205 Regain sorting capabilities.
206 Creating an overview of grades showing frequencies
207 Creating an overview of grades showing individual names