cs 11 Chapter 2

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

1/28

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:54 AM on 9/15/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

29 Terms

1
New cards

Simple Data Type

• Integral: integers (numbers without a decimal)

- Can be further categorized: char, short, int, long, bool, unsigned char, unsigned

short, unsigned int, unsigned long

• Floating-point: decimal numbers

• Enumeration: a user-defined data type

2
New cards

Variable

a memory location whose contents can be changed

3
New cards

String

A data type used to store a sequence of characters, such as letters, numbers, spaces, or symbols

4
New cards

Unary operator

An operator that works on one operand (one value or variable).


5
New cards

Binary operator

:An operator that works on two operands (two values or variables).

6
New cards

Prompt Line

executable statements that inform the user what to do

7
New cards

Syntax

The set of rules that determine how code must be written in a programming language so the computer can understand it.

8
New cards

Token

special symbols, word symbols, and identifier + - *

9
New cards

Mixed Arithmetic Expression

An arithmetic expression that contains different types of numbers, such as integers and decimal (double) values.

10
New cards

Precision

maximum number of significant digits

11
New cards

Number of digits in float?

Range: -3.4 1038 to 3.4

1038 (four bytes)

12
New cards

Number of digits in double?

Range: –1.7 10308 to 1.7

10308 (eight bytes

13
New cards

how many bytes of storage are allocated in int?

4

14
New cards

how many bytes of storage are allocated in float?

4

15
New cards

how many bytes of storage are allocated in double?

8

16
New cards

how many bytes of storage are allocated in char?

1

17
New cards

Maximum number of significant

digits (decimal places) for float

6 or 7

18
New cards

Maximum number of significant

digits for double

15

19
New cards

order of math operations in C++

  • Parentheses ( )

  • Unary operators +, -, ++, --

  • Multiplication, Division, Modulus *, /, %

  • Addition, Subtraction +, -


20
New cards

what results when using integer division

no round just one 1 so 1.5 is just 1 instead of 2

21
New cards

what results when using remainder operator

gives the reminder when dividing two numbers

22
New cards

what characters are allowed in an identifier name.

  • Letters: A–Z, a–z

  • Digits: 0–9

  • Underscore: _


23
New cards

what characters are consider whitespaces in C++.

  • pace

  • Tab \t

  • Newline \n

  • Carriage return \r

  • Form feed \f

  • Vertical tab \v


24
New cards

what symbol is called the “statement terminator”

;

25
New cards

how escape sequences are used in output

Special characters that begin with a backslash \ and are used to perform special actions in output.

26
New cards

what named constants are used for.

A constant value that is given a name so it can be used throughout a program without being changed.

27
New cards

hat comments are used for

Text written in a program to explain or document the code. They are ignored by the compiler and do not affect how the program runs.

28
New cards

what endl does in an output statement

Ends the current line of output and moves the cursor to the next line

29
New cards

how to use static_cast.

cout << static_cast<double>(a) / b;