Class 2: Input/Output and Decision Making
In this class, we'll cover the details of Console Input/Output and how it relates to interactive computer programs, Boolean operators and expressions and decision making constructs (known as branching). The end goal is to build a fun and interactive, simple, text-based guessing game!
We'll discuss the intricacies of dealing with the console for input and output, namely the supplying and printing of data to and from our programs, respectively. We'll then tackle the tools and constructs for building "questions" in our language: asking whether or not some truth holds; this will allow our program to behave differently based on the determined answer. Once we know how to ask questions, then we can use decision making statements to build the logic of our programs. These tools will significantly help us build our interactive, text-based, guessing game!
Topics to discuss:
Console Output vs. Input (cout vs. cin)
Escape Sequences
Basic Output Formatting using IOManip
Relational Operators
Boolean Operators and their Truths
Boolean Expressions
If, If/Else, and Switch statements
The Guessing Game
We'll discuss the intricacies of dealing with the console for input and output, namely the supplying and printing of data to and from our programs, respectively. We'll then tackle the tools and constructs for building "questions" in our language: asking whether or not some truth holds; this will allow our program to behave differently based on the determined answer. Once we know how to ask questions, then we can use decision making statements to build the logic of our programs. These tools will significantly help us build our interactive, text-based, guessing game!
Topics to discuss:
Console Output vs. Input (cout vs. cin)
Escape Sequences
Basic Output Formatting using IOManip
Relational Operators
Boolean Operators and their Truths
Boolean Expressions
If, If/Else, and Switch statements
The Guessing Game