COSC 1436 - Video Questions
Based on what you learned in "Tutorial - If Statements in C++" video, what would the follow evaluate to: T && F = ?
1) 0 2) False WHY : In C++, 1 means true and 0 means false
According to "Introduction to Arrays in C++ Tutorial" video, an array is a variable that can store one value of some type.
False : it can store MULTIPLE values of the SAME type
According to "For Loop While Loop and Do While Loop in C++ Programming" video, a loop is a control structure that causes statements or statements to repeat
True
According to "For Loop While Loop and Do While Loop in C++ Programming" video, do-while loop is a post test loop and following is the syntax do { statement; statement; } while ( expression );
True
According to "For Loop While Loop and Do While Loop in C++ Programming" video, for loop is a pre-test loops and following is the for loop syntax for (initialization; expression; update counter) { statement; statement; }
True
According to "For Loop While Loop and Do While Loop in C++ Programming" video, when checking for input validation while using while loop we can use (!cin) to check for any other type aside from what the program is asking the user to input
True
According to "For Loop While Loop and Do While Loop in C++ Programming" video, while loop is a pre-test loop and following is the while loop syntax while ( expression ) { statement; statement; counter; }
True
According to "Introduction to Arrays in C++ Tutorial" video, off-by-one is a common error in array since the indexing goes from n to n-1
True
According to "Introduction to Arrays in C++ Tutorial" video, when opening a file in C++ we must put a " " around the name of the file.
True
According to "Tutorial - If Statements in C++" video, a nested if statement is when we have an if statement within an if statement
True
According to "Tutorial - If Statements in C++" video, if we have more than one statements under our if statement, we MUST put our if statements in a block statements using "{}", otherwise only the first statement will be read/executed as part of the if statement's condition.
True
According to "Tutorial - If Statements in C++" video, there is a difference between "==" and "=" sign. "==" means equal to.
True WHY : == means equal to while = is assigned
Which one of the following code segment will print the elements of the following array : int numArray[ ] = {1, 2, 3, 4};
for ( int = 0; i < numArray[ i ]; i++ ) { cout << numArray[ i ] << " "; _
Based on the "Tutorial - If Statements in C++" video, following is the right way of writing "average is greater or equal to 90 and less than or equal to 100" in an if statement
if (average >= 90 && average <= 100)
According to "Introduction to Arrays in C++ Tutorial" video, which one of the following is the correct way of declaring an integer two dimensional array named myArray with 3 rows and 2 columns
int myArray[3][2]