CSC 1060 Week 05 Selection PDF
Document Details
Uploaded by DivineZebra9695
Red Rocks Community College
Tags
Summary
This document covers week 5 of a computer science course, CSC 1060. It introduces control structures, relational operators, logical statements in C++ programming, and problem-solving examples.
Full Transcript
CSC 1060 CONTROL STRUCTURES: SELECTION OBJECTIVES AGENDA: WEEK 05 Create decision making 1. Logic problem: Square Table statements in a C++ program 2. Control Structures using different forms of if..else...
CSC 1060 CONTROL STRUCTURES: SELECTION OBJECTIVES AGENDA: WEEK 05 Create decision making 1. Logic problem: Square Table statements in a C++ program 2. Control Structures using different forms of if..else 3. Relational Operators statement. 4. One-way & Two-way Selection Use logical expressions in a 5. Multi & Nested Selection program. 6. Compound operators || && Explain program flow. 7. Review: Multiple Choice ?'s 8. TODO & Resources for help There are four people Alice Skater one is a skater that are sitting around a Carol Gymnast one is a gymnast square table Brian Swimmer one is a swimmer David Tennis one is a tennis player Alice Skater WHO IS THE Alice Skater Carol Gymnast Carol Gymnast Brian Swimmer TENNIS Brian Swimmer David Tennis PLAYER? David Tennis The swimmer sat on Alice Skater Carol and David Alice's left. Carol Gymnast sat next to each other. The gymnast sat Brian Swimmer A woman sat on across from Brian. David Tennis the skater's left. OVERVIEW OF CONTROL STRUCTURES Control Structures are just a way to specify flow of control in programs. A control structure analyzes and chooses in which direction a program flows based on certain conditions. There are three types of logic, or flow of control, known as: Sequence logic, or sequential flow (last week, Topic 2) Selection logic, or conditional flow (NOW) Iteration logic, or repetitive flow (next week, Topic 4) Source: GeeksforGeeks CONTROL STRUCTURES: SELECTION Prompt user for Declare variable Get input from Determine if the input to store input user person is of age to vote std::cout Content > Resources for Help