Input / Output
Error Checking
Math
Strings
Random Topic???
100
Which of the following bits of code is correct?
a. cout >> "Hello world!";
b. cout << "Hello world!' << endl;
c. cout << "Hello world!\n";
d. cout << Hello world! << endl;
c. "Hello world!\n";
would output:
Hello world! followed by a new line
100
This type of error will still compile but usually causes your program to do something you didn't intend
What is a logic error?
or
What is a runtime error?
or
What is a bug?
100
What is the value of x after the code executes?
int x = 10;
x = x/6+2*7+x;
25
100
string myString = "Victor E. Bulldog";

What are the index values of myString?
What is the length of myString?
Index values: 0-16
Length: 17
100
This library allows the use of inputting and outputting information to and from a program
What is #include &#60iostream&#62?
200
What are "cin" and "cout" short for?
Characters in
Characters out
200
Indicate if there is a syntax error in the following code:

const double piValue = 3.14;
piValue = 3.14159
Redeclaring a constant variable
200
What is the value of x after the code executes?
int x = 10;
x = x*2;
x = cos(x/40);
x = pow(x,2);
1
200
This is a constant in the string library that is used to indicate that a string is empty.
What is string::npos?
200
What are the possible numbers that x could be?

x = (rand()%5)*2+1;
1, 3, 5, 7, 9
300
What is the output of the following code?:

int x = 8;
switch(x) {

case 1:
cout << "first case";

case 8:
cout << "middle case";

default:
cout << "default case";

}
middle casedefault case
300
It's your lucky day. I got bored writing these questions. Give your SI Leader a compliment and your team gets 300 points.
There's only one of these freebies in the game. Don't get your hopes up for later ;)
300
Two different ways to ensure you get a decimal answer when dividing an integer.
What is adding a decimal to the denominator?
What is static casting?
300
What is stored in myString after the following code executes?

string myString = "I Just Haven't Met You Yet";
myString.resize(myString.length()/2);
myString.resize(myString.length()/2);
myString = myString + myString;
I JustI Just
300
This occurs when the value being assigned to a variable is greater than the maximum value the variable can store.
What is overflow?
400
What will the output of the program be?

string myString = "CSCI40!";
myString[1] = tolower(myString[1]);
if (isdigit(myString[6]))
myString.resize(4);
cout << "40";
myString.append("2017");
cout << myString << endl;
40CsCI40!2017
400
Indicate if there is a syntax error in the following code:

int x = 5;
x +=1;
if(x >2);
cout << "x is greater than two";
No syntax error. But there is a logic error :)
400
What number does the following evaluate to?:
floor(sqrt((ceil(pow(5, 2)/10.0)+8%3)));
2
400
What is stored in myString after the following code executes?

string myString = "DbsmptObwbssp";
for (int i = 0; i<myString&#46length(); i++) {
myString[i] = (myString[i]-1);
}
CarlosNavarro
400
What value must userNum be for the last else statement to execute?

if(userNum%2 != 0) { }
else if (userNum >= 0) { }
else if (userNum <= -10) { }
else if(userNum*2 < -10) { }
else if(userNum == -2) { }
else { cout << "else" << endl; }
-4
500
Which of the following would would output the letter 'B'?

a. cout << 'A' + 1 << endl;
b. cout << static_cast&#60char&#62('A'+1) << endl;
c. cout << 'A' + '1' << endl;
d. cout << static_cast&#60char&#62['A'++] << endl;
b. cout << static_cast&#60char&#62('A'+1) << endl;
500
Indicate if there is a syntax error in the following code:

string old = "1998 Honda Civic";
string new = "2017 BMW X5";
"new" is a reserved keyword. It can't be used as a variable name.
500
Write a piece of code that print out the result of the quadratic formula using variables:
double a, b, c;
cout << (-b+sqrt(pow(b,2) - 4*a*c))/(2*a);
cout << endl; cout << (-b-sqrt(pow(b,2) - 4*a*c))/(2*a);
500
string website = "http://my&#46fresnostate&#46com";
Modify website to read "https://my&#46fresnostate&#46edu" without redeclaring it.
website.insert(4, "s"); website.replace(23, 3, "edu");
500
Convert the decimal number 72 to base 4.
1020
M
e
n
u