Branching Topic 4.3.8 / Core
- how to change the direction of a program depending on conditions;
- the if statement;
- the switch statement.
- Kjell chapter 12 - 14
If - one of the biggest words in the English language
- Work through the presentation on Branching.
- Pick up where you left off with the HelloThere project, but this time turn it into a totally interactive conversation where the computer's behaviour varies according to the answers given.
- Here is a version of the AddingMachine project. Adapt it to allow the user to choose addition, subtraction, multiplication or division.
- Study and run this source code for a temperature converter. Rewrite it using the switch statement.
- Write a currency converter that can convert between euros, dollars, pounds AND another currency of your choice. Your program must be user-friendly and allow all of the 12 possible conversions.
- Extension work: Try the Warmup-1 Java exercises on the CodingBat web site.
- Continue to work through the problems in the Java Problem Set 1<.
- Try some of the programming exercises at the end of Eck's chapter 2.