1/35
Flashcards covering key concepts from Chapter 2: Getting Started in C++ Programming Today.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is algorithm design?
The process of creating a set of steps or rules to solve a problem before you start writing code.
What should you do before you start entering source code according to algorithm design?
Create a plan of steps (an algorithm) that solves the problem.
In the Counting Sheep example, what is the first character the program looks for when counting sheep?
The letter 's'.
After finding an 's' in the counting algorithm, what is the next character the program checks?
The letter 'h'.
What letter sequence is checked to confirm the word 'sheep' in the counting algorithm?
s-h-e-e-p.
What action is taken when a complete 'sheep' sequence is found in the text?
Increment the sheep-counter.
In the Surface Area example, what are the three parts of the can used to compute total area?
Top area, bottom area, and the rectangular side area.
What is the area of the top (or bottom) circle of a cylinder?
πr^2 (for each end).
What is the side area of a cylinder in terms of radius r and height h?
Circumference times height = (2πr) × h.
What is the total surface area formula for a cylinder?
2πr^2 + 2πrh (top + bottom + side).
Step 1 of Steps to Programming Success?
Read the problem statement and understand inputs, outputs, and desired results.
Step 2 of Steps to Programming Success?
Identify the software requirements and the main components and their order.
Step 3 of Steps to Programming Success?
Build a base version using pencil and paper; plan with diagrams or pseudocode; identify testable items.
Step 4 of Steps to Programming Success?
Evaluate the base version, test it, fix issues, and plan the next version.
Step 5 of Steps to Programming Success?
Implement new tasks for the next version and document the code.
Step 6 of Steps to Programming Success?
Evaluate against requirements, obtain feedback, test, and plan the next iteration.
What does the term 'bug' mean in programming?
A general catchall for something causing the program not to run correctly.
What does 'class' mean in the Terminology section?
A job description for a program component, including tasks and associated data.
What does 'code' mean in this context?
Textual phrases written in C++ that represent a program (or part of it); can refer to a line or the whole program and can refer to machine code.
What is a compiler?
Software that reads C++ statements, checks syntax, and produces object or machine code.
What is a debugger?
A tool that runs the program step by step and lets you examine portions to locate bugs.
What is an executable in this context?
The machine language file that the operating system reads to run the program.
What is an IDE?
Integrated Development Environment; provides tools for building software, including editing, linking, and executing.
What is an object in object-oriented terms?
An instance of a class.
What is object code?
The file produced by the compiler, containing machine language.
What is RAM?
Random Access Memory; fast storage used while a program runs.
What is source code?
The text-based file containing C++ statements that the compiler reads.
What is syntax in programming?
The correct arrangement of language elements (grammar and punctuation) in C++.
Is C++ case sensitive, and what does that imply?
Yes; identifiers like total, Total, and TOTAL are treated as different.
Where is the starting point of a C++ program?
The main() function.
What does #include
A preprocessor directive that tells the compiler to include the iostream library.
What is the purpose of using namespace std;
To indicate the program uses the standard C++ namespace, helping avoid naming conflicts; should follow #include statements.
What is the typical output of a Hello World! program as shown in the notes?
Hello World!
What are the two ways to write comments in C++?
Single-line comments with // and multi-line comments with /* … */.
What are some libraries mentioned for math, IO, and formatting?
What is the role of the main function in the program director analogy?
It is the starting point that calls other program components via functions or objects.