COM SCI 31 Lecture Notes - Lecture 6: Code-Switching, Boolean Expression, Undefined Behavior

40 views7 pages
15 Oct 2016
School

Document Summary

Bad rating the opposite: if (rating >=1 || rating <= 10) //would be true for all values. should be an and statement. for true opposites, usually or/and operators must be switched. opposite of > is = not a north american because of short circuit evaluation and false || true -> tru -> cout statement. Bad choice and leave bye bye case constant; 4 -> do commands for case 4, break takes you out of switch statement and continue with the rest of code. 2 -> gets treated the same way as case 4 default is like the final else dont" leave switch statement unless you hit a break statement or reach the end if you forget a break after case 4. 2 -> treated like 4, do some stuff -> continue with statements for.

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