What cout << "Hi" << endl << "there" << endl; will print out.
What is
Hi
there
int bob = 1;
while(bob < 3){
cout << bob << endl;
}
1
2
what variable type should fill the blank
_____ myNum = 9;
int
string cars[3] = {"Volvo", "BMW", "Ford"};
cout << cars[1] << endl;
BMW
What will print out
int cats = 3;
//cats = 5;
cout << "bob has " << cats << " cats";
What is
bob has 3 cats
int n = 15;
while(n >= 0){
if(n % 4 == 0) cout << n << endl;
n--;
}
12
8
4
0
What variable type should fill each of the blanks
____ bob = 8.99;
____ hi = 'P';
____ hello = false;
____ cake = "I love cake";
double
char
bool
string
string cars[3] = {"Volvo", "BMW", "Ford"};
cars[1] = "Mazda";
cout << cars[1] << endl;
Mazda
what this will print out
cout << "3 + 1" << endl;
cout << 3 + 1 << endl;
What is
3 + 1
4
for(int i = 1; i <= 5; i++){
cout << i << endl;
}
1
2
3
4
5
What variable type should I use when I want to store a number that counts how many people there are on earth (7.8 billion people)
_____ peopleOnEarth = 7800000000;
long long
string cars[4] = {"Volvo", "BMW", "Ford", "Tesla"};
for(int i = 0; i < 4; i++){
cout << cars[i] << " ";
}
Volvo BMW Ford Tesla
cout << "Hi there!" << 3 + 2 % 4 << "this is fun\n" << 2 * 4;
What is
Hi there!5thisisfun
8
for(int j = 0; j > -5; j--){
cout << j << endl;
}
0
-1
-2
-3
-4
int cats = 100;
bool catLady = false;
if(cats > 3) catLady = true;
if(catLady) cout << "She has too many cats!" << endl;
else cout << "She is not a cat lady" << endl;
string name = "Bob Lee";
name[0] = 'R';
cout << name << endl;
Rob Lee
int a = 5;
int b = 9;
int c = 0;
if(a * b == 44) c = 23;
else c = 14;
if(a - b > 0) c = c + 5;
if(b % a == 4) c = c - 2;
cout << "c is " << c << endl;
What is
c is 12
for(int p = 1; p <= 20; p = p + 2){
if(p % 15 == 0) break;
cout << p << endl;
}
1
3
5
7
9
11
13
string bob = "this is a ";
string boberta = "fantastic string";
string hi = bob + boberta;
cout << hi << endl;
this is a fantastic string
string cars[4] = {"Volvo", "BMW", "Ford", "Tesla"};
for(int i = 3; i >=0; i--){
cout << cars[i] << endl;
}
Tesla
Ford
BMW
Volvo