INSY 3433 Lecture Notes - Lecture 3: Switch Statement, Infinite Loop

51 views3 pages

Document Summary

Control statement overview: selection statements statements that deal w/ which statements get executed, if/else statements, switch/case statements, repetition statements statements that deal w/ how many times statements execute, for, while, & do while statements. Control statements if/else: the if statement controls whether a statement/set of statements will execute, there is a test condition part of the statement to decide if the statement(s) will execute, ex: if (val > 0) { Control statement if/else: the else statement can pair w/ an if statement & controls whether an alternative statement/group of statements will execute, ex: if (val > 0) { System. out. println( value is 0 or negative ): the else if statement allows for multiple conditions to be checked, ex: if (val > 0) { System. out. println( value is positive ); else if (val == 0) { else { Control statements nested if/else: statement under an if/else can be an if/else, ex: if (val > 0) {

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents