• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 1 fuera de 4 páginas
Resumen

Summary Programming Logic and Design Ch 4

Document preview thumbnail
Vista previa 1 fuera de 4 páginas

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.

Vista previa del contenido

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

Libro relacionado
 image
Editorial: 2023 ISBN: 9780357880876 Edición: Desconocido

Información del documento

¿Un libro?
No
¿Qué capítulos están resumidos?
4
Subido en
15 de noviembre de 2025
Número de páginas
4
Escrito en
2025/2026
Tipo
Resumen
$3.75

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
tanjanel1303
5.0
(2)
Vendido
11
Seguidores
2
Artículos
47
Última venta
1 mes hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes