Overview
This week’s exercises cover a variety of topics:
- more practice on reading values from the command-line, and then printing results by carrying out various operations on the input;
- using conditional (if-then-else) statements;
- using for loops.
We will also briefly talk about different types of errors in programming — compile vs runtime vs logic errors.
Note
From this week, you should be using the IntelliJ IDE and JUnit as explained in the Introduction to Development Tools.
Note
There are three types of exercise here: warmup, core, and optional. The warmup exercises are to give you a refresher of material that you may have already encountered. As the name suggests, you should definitely do the core exercises. We recommend that you try the optional exercises for extra practice.
Difficulty | Question | Description |
---|---|---|
warmup | Q1 | Integer Distance |
Q2 | Largest Double | |
Q3 | Evaluating Boolean Values | |
Q4 | Face-Printing (Pair Programming) | |
core | Q5 | Quadratic Equations |
Q6 | Polar Coordinates (Pair Programming) | |
Q7 | Safer Fixed Divider | |
Q8 | Safer Quadratic Solver | |
Q9 | Squares Loop (Pair Programming) | |
optional | Q10 | Lopsided Number Triangle |
Q11 | Gambler's Ruin (Pair Programming) | |
Q12 | Quadratic Solver With Imaginary Parts |