Home
Explore
Exams
Login
Get started
Home
Engineering
Computer Science
Comp 1500 Test 2
0.0
(0)
Rate it
Studied by 2 people
Call Kai
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Knowt Play
Card Sorting
1/15
Earn XP
Description and Tags
Computer Science
All Modes
Learn
Practice Test
Matching
Spaced Repetition
Call with Kai
Last updated 3:49 AM on 10/14/22
Update
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
No analytics yet
Send a link to your students to track their progress
16 Terms
View all (16)
Star these 16
1
New cards
int
integer
2
New cards
float
floating point number (less precision)
3
New cards
double
floating point number (greater precision)
4
New cards
bool
Boolean [true or false]
5
New cards
char
character [stored by ASCII value]
6
New cards
two way choice
if (cond)
A;
else
B;
*if either of these is longer than one line, that one needs a { }
7
New cards
pre test loop
while (cond)
A;
8
New cards
post test loop
do
A;
while (cond);
9
New cards
The four parts of any valid loop:
1. Initialization
2. Continuation
3. Update
4. Loop Body
10
New cards
example of fixed
float f = 1.5;
cout << fixed << f;
output: 1.500000
11
New cards
scientific ex
float f = 1.5;
cout << scientific << f;
output: 1.500000e+00
12
New cards
defaultfloat
float f = 1.5;
cout << f << endl; 1.5
cout << fixed << f << endl; 1.500000
cout << defaultfloat << f; 1.5
13
New cards
setprecision
float f = 1.5;
cout << fixed << f << endl; 1.500000
cout << setprecision(2) << f; 1.50
14
New cards
setw
string s = "Hello!";
cout << s << endl; Hello!
cout << setw(10) << s; [4 spaces] Hello!
15
New cards
setfill
string s = "Hello!";
cout << setw(10) << setfill('$') << s;
Hello!
16
New cards
left, right
string s = "Hello!";
cout << setw(9) << s << endl;
cout << setw(9) << left << s << endl;
cout << setw(9) << right << s << endl;
Hello!
Hello!
Hello!