100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Summary

Summary Programming Logic and Design Ch 4

Rating
-
Sold
-
Pages
4
Uploaded on
15-11-2025
Written in
2025/2026

This document provides an in depth and thorough summary of chapter 4 of Programming Logic and Design. It is ready for exam and tests. Everything is laid out as it is in the textbook. All needed information is provided in short. It is written in an easy to study format and reads easy. I got distinctions in exams and tests.

Show more Read less
Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
4
Uploaded on
November 15, 2025
Number of pages
4
Written in
2025/2026
Type
Summary

Subjects

Content preview

Chapter 4

Describe the selection structure
 Boolean expressions can only be true or false (yes or no / 1 or 0) - used in every selection
structure
 Dual-alternative (binary) selection structure- action for each possible outcome-
true/false (if-then-else)
 Single-alternative (unary) selection structure- actions for only one outcome (if-then) -
otherwise null
 if then clause- holds action executed when condition in decision is true
 else clause- executes only when tested condition in decision is false


List the relational comparison operators
 Relational comparison operators
 Two values compared could be variables or constants
 Variables have to be the same data type

= > < >= <= <>
equal greater less than greater or less or not equal
(==) than equal equal (! =)

  Restrict use of "if without else" - only take action when comparison is false (best to use
positive (true) outcome)
 Sometimes code is clearest in negative "if without an else"
if customerZipCode <> LOCAL_ZIP_CODE then
total = total + deliveryCharge
endif
 Trivial expression (currentTotal = previousTotal)
 Will always evaluate to the same result, never use
 Example: true for 20 = 20 / false for 30 = 40
 Common mistakes when using relational operators
 missing boundary for selection, double check – saying over 65, is it >65 or >= 65?


Use AND logic
 Compound condition - ask multiple questions before outcome is determined
 AND decision
 Requires that both of the two tests evaluate to true
 Requires a nested if or a cascading if statement


 Nesting AND decision for efficiency
 With nesting decisions, either selection can come first
 Performance time can be improved by asking questions in the right order
$3.89
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
tanjanel1303 Rosebank College (Pretoria)
Follow You need to be logged in order to follow users or courses
Sold
10
Member since
1 year
Number of followers
2
Documents
47
Last sold
2 months ago

5.0

2 reviews

5
2
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions