Start learning today, and be successful in your academic & professional career. Start Today!

• ## Related Services

 0 answersPost by Ying Feng on January 30 at 12:37:16 AMDear Professor, How to solve the following problem:// precondition: x>=0public void mystery(int x){  if ((x/10)!=0)  {  mystery(x/10);  }  System.out.print(x%10);}Looking forward to your response.best regards,Eva

### Conditional Statements

• The if statement adds decision-making capability to a program
• The if-else statement takes one of two actions based on a condition
• If and if-else statements can be nested as many levels deep as desired
• The extended-if statement takes one of many actions based on multiple conditions
• The switch statement is another way to take one of many actions (not in AP subset)

### Conditional Statements

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

• Intro 0:00
• Conditional Statements 0:55
• Based on Value of a Boolean Expression
• Switch Statement
• The If Statement 2:59
• Structure of If Statement
• The If-Else Statement 4:46
• The If-Else Statement 6:02
• If expression - False
• Nested If-Else Statements 7:13
• 'Nest'
• Nested If-Else Statements 7:56
• First Thing to Determine
• Code
• The Extended If Statement 13:14
• Code
• The Switch Statement 18:54
• The Way It Works
• Example: Switch Statement in a Java Program
• Summary 27:03