C++ Programming Today - Chapter 2: Getting Started: Data Types, Variables, Operators, Arithmetic, Simple I/O and C++ Strings

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/35

flashcard set

Earn XP

Description and Tags

Flashcards covering key concepts from Chapter 2: Getting Started in C++ Programming Today.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards

What is algorithm design?

The process of creating a set of steps or rules to solve a problem before you start writing code.

2
New cards

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.

3
New cards

In the Counting Sheep example, what is the first character the program looks for when counting sheep?

The letter 's'.

4
New cards

After finding an 's' in the counting algorithm, what is the next character the program checks?

The letter 'h'.

5
New cards

What letter sequence is checked to confirm the word 'sheep' in the counting algorithm?

s-h-e-e-p.

6
New cards

What action is taken when a complete 'sheep' sequence is found in the text?

Increment the sheep-counter.

7
New cards

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.

8
New cards

What is the area of the top (or bottom) circle of a cylinder?

πr^2 (for each end).

9
New cards

What is the side area of a cylinder in terms of radius r and height h?

Circumference times height = (2πr) × h.

10
New cards

What is the total surface area formula for a cylinder?

2πr^2 + 2πrh (top + bottom + side).

11
New cards

Step 1 of Steps to Programming Success?

Read the problem statement and understand inputs, outputs, and desired results.

12
New cards

Step 2 of Steps to Programming Success?

Identify the software requirements and the main components and their order.

13
New cards

Step 3 of Steps to Programming Success?

Build a base version using pencil and paper; plan with diagrams or pseudocode; identify testable items.

14
New cards

Step 4 of Steps to Programming Success?

Evaluate the base version, test it, fix issues, and plan the next version.

15
New cards

Step 5 of Steps to Programming Success?

Implement new tasks for the next version and document the code.

16
New cards

Step 6 of Steps to Programming Success?

Evaluate against requirements, obtain feedback, test, and plan the next iteration.

17
New cards

What does the term 'bug' mean in programming?

A general catchall for something causing the program not to run correctly.

18
New cards

What does 'class' mean in the Terminology section?

A job description for a program component, including tasks and associated data.

19
New cards

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.

20
New cards

What is a compiler?

Software that reads C++ statements, checks syntax, and produces object or machine code.

21
New cards

What is a debugger?

A tool that runs the program step by step and lets you examine portions to locate bugs.

22
New cards

What is an executable in this context?

The machine language file that the operating system reads to run the program.

23
New cards

What is an IDE?

Integrated Development Environment; provides tools for building software, including editing, linking, and executing.

24
New cards

What is an object in object-oriented terms?

An instance of a class.

25
New cards

What is object code?

The file produced by the compiler, containing machine language.

26
New cards

What is RAM?

Random Access Memory; fast storage used while a program runs.

27
New cards

What is source code?

The text-based file containing C++ statements that the compiler reads.

28
New cards

What is syntax in programming?

The correct arrangement of language elements (grammar and punctuation) in C++.

29
New cards

Is C++ case sensitive, and what does that imply?

Yes; identifiers like total, Total, and TOTAL are treated as different.

30
New cards

Where is the starting point of a C++ program?

The main() function.

31
New cards

What does #include do?

A preprocessor directive that tells the compiler to include the iostream library.

32
New cards

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.

33
New cards

What is the typical output of a Hello World! program as shown in the notes?

Hello World!

34
New cards

What are the two ways to write comments in C++?

Single-line comments with // and multi-line comments with /* … */.

35
New cards

What are some libraries mentioned for math, IO, and formatting?

for math functions, for input/output, and for output formatting.
36
New cards

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.