• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 4 pages
Summary

Summary Programming Logic and Design Ch 4

Document preview thumbnail
Preview 1 out of 4 pages

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.

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

Connected book
 image
Publisher: 2023 ISBN: 9780357880876 Edition: Unknown

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
CA$5.27

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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
5.0
(2)
Sold
11
Followers
2
Items
47
Last sold
1 month ago




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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions