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 <iostream>?
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.