# CMPT 100 Lecture Notes - Dial Tone, Problem Solving

46 views1 pages
Published on 2 Feb 2013
School
Course
To define a conditional task in terms of the condition and the task.
-
Use if, if/else, nested if/else, chained if/else to define conditional tasks.
-
Relational expressions.
Boolean expressions.
Context is often determined by:
-
-
Express the condition.
-
How to recognize dial tone, etc
You may need to consider things that are not explicitly mentioned, e.g.,
-
Problem solving
Like a plan that is designed to handle several possibilities.
-
Only one context is true at any time.
-
When performing the task, you know which one is true.
-
You don't know which one is true!
You have to plan for both cases.
When designing the algorithm.
-
It's generally in the form of a statement that may come with a condition.
-
We can include any sub-task as part of an if statement
-
Indentation shows the extent of the subtasks in the then-clause.
-
The if statement.
The else part is optional.
The if-else statement is a special case of the if/else statement.
-
The if/else statement
January-31-13
9:56 AM
CMPT 113.3 Page 1
Unlock document

This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.