CS2010 - Set 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/9

flashcard set

Earn XP

Description and Tags

Set one

Last updated 7:01 PM on 12/9/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

10 Terms

1
New cards

Declare an identifier capable of holding a whole number

int number;

2
New cards

Declare an identifier capable of holding a series of letters

#include <string>

string text;

3
New cards

Declare an identifier capable of holding the value Pi

const double PI = 3.14159;

4
New cards

Declare an array variable capable of holding prices of items in a store

double prices[100];

5
New cards

List operators in order of precedence, including rational operators and logical operators

Parentheses (highest), Unary, multiplication, additive, Relational, Equality, Logical AND (&&) ( , Logigcal OR ( | | ), Assignment (=,+=)

6
New cards

For loop, iterate 109 times (start doesn’t matter):

for (int i = 0; i < 109; ++i)

7
New cards

100 iterations, even values starting from 0:

for (int i = 0; i < 200; i += 2)

8
New cards

Sentinel-controlled while loop until -1:

int val;
while (cin >> val && val != -1)

9
New cards

While loop: read file until EOF and count items:

ifstream in("in.dat");
int x, count = 0;
while (in >> x) { ++count; }

10
New cards

Do-while input validation (0–100 inclusive):

int num;
do {
    cout << "Enter 0–100: ";
    cin >> num;
} while (num < 0 || num > 100);