CS 161 Lecture Notes - Lecture 4: Switch Statement

25 views2 pages

Document Summary

Cs 161 lecture 4 more conditionals (short lecture: guest speakers and group work) If/else/if else: put some condition and if it is true it will act out. If it is false it will go to the else or if else statement: different categories in same questions, the computer will keep going down the options until one of them is true. Relational and logical operators: used to test variables, == equality, >= greater than or equal to, <= less than or equal to, > greater than, < less than. I i or: and: if((1/2) && (2/5), or: if((1>2) i i (2>5), not: if(! (1>2) && (2<5), non-zero numbers are true and zero is false. Short circuiting: compiler wants to be lazy, for and statements, if the first one is false, does not check the second one, problems can occur because maybe the whole statement is true.

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

Related Questions