COP 3502 Chapter Notes - Chapter 3: Semicolon, Boolean Expression, Switch Statement

50 views3 pages

Document Summary

The program can decide which statements to execute based on a condiion. Selecion statements: statements that let you choose acions with alternaive courses. Boolean expression: an expression that evaluates to a. Boolean variable: a variable that holds a boolean value. Boolean literals: true and false, treated as reserved words and cannot be used as ideniiers in the program. An if statement is a construct that enables a program to specify alternaive paths of execuion. One-way if statement: executes an acion if and only if the condiion is true. The syntax for a one-way if statement is: if (boolean-expression) { statement(s); } Flowchart: a diagram that describes an algorithm or process, showing the steps as boxes of various kinds, and their order by connecing these with arrows. An if-else statement decides the execuion path based on whether the condiion is true or false.

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