- Team assignments: Section A, Section B
- Start: 2nd half of class, Thu 9/14
- End: Quiz in 1st half of class, Thu 9/28
- Requirements Due: beginning of class, Thu 9/28
Troll: What is the airspeed velocity of an unladen swallow?
King Arthur: What do you mean, African or European?
A fundamental component of many computing problems is determining the conditions of the problem and then providing different methods of solving the problem depending on the conditions. In order to create a program that can behave in different ways depending on what is happening, we need to learn about decisions and conditional code structures. In essence, we will learn how to write code that will state the airspeed velocity of an African swallow if the user answers African, states the velocity of a European swallow if the user answers European, and re-asks the question if the user answers with some other response.
Responsibilities (What you need to know):
- (4.2) Know how to read the Math class API and use Math methods
- (4.3) Use the Scanner class to acquire input from the keyboard
- (4.5) Understand how to work with String object variables
- (5.1) Write an if statement by comparing native data types
- (5.1) Write an if statement using braces and proper indentation
- (5.1) Write an if-else statement
- (5.1) Understand when to use multiple if statements and when to use if-else statements
- (5.2) Know the meaning of and how to use the 6 relational operators: == != <= >= < >
- (5.2) Be aware of issues comparing double values and know how to compare using a tolerance
- (5.2) Understand how to compare String objects using the equals and compareTo methods
- (5.2) Understand to avoid using == and != for String object comparisons
- (5.2) Understand that, in general, == and != should be avoided for comparisons of any object variables
- (5.3) Write if-else if and if-else if-else statements and understand multiple branches
- (5.4) Understand how to read code that contains nested branches
- (5.4) Write nested conditional code statements and know when to use them
- (5.4) Understand the scope of a variable (where it’s born, where it lives, and where it dies)
- (5.7) Understand the boolean native data type and be able to declare boolean variables
- (5.7) Be able to understand and implement boolean methods
- (5.7) Know the meaning of and how to use the 3 boolean operators: && || !
- (5.7) Understand why x < y < z is not allowed and why x < y && y < z is the correct equivalent syntax
Requirements (What you need to do):
Individual Requirements:
- Understand the concepts on the Responsibilities list.
Team Requirements:
More information may be posted later; use expert requests to ask for additional materials
In a traditional classroom we might adopt this schedule:
- Homework for Tuesday: Read (or Reread) Chapter 4. Pay attention to: the format of method headers, what the word "return" means, and how to work with Strings.
- Tuesday in class: Lecture on how methods are created & how Strings are stored. Do warmups on Math and String. Start homework requirements.
- Homework for Thursday: Do Math and String Requirements.
- Thursday in class: Lecture on Booleans and If statements, work Warm up problems (rest) and practice on coding bat.
- Homework for Tuesday: Do rest of requirements problems.
- Tuesday: Go over trickiness with if statements - most seen errors. Practice & review for quiz.
- Homework for Thursday: Practice and study!