True or False
One array can store more than one data type
False
When would you use for loops over while loops?
When you know how many times it will execute!
What is the name of this operation ">>"?
True or False
unsigned data types have more numbers than signed data types
False, they have the same amount of numbers.
When and where is my office hour?
Wednesday 10:00 - 11:00 Oldmain 2050
Yes!
When would you use while loops over for loops?
When you are unsure the number of times of execution!
What is the name of this operator "<<"?
Insertion operator!
True or False
a char variable has an number value
True, it has ASCII values!
When and where is my next SI Session?
Thursday Aug, 29 6:20-7:35 Old main 2050
What is the square bracket '[]' operator used for?
Access an element at a specific index!
Checks condition for executing the code block
True or False
I don't need to close the file after I'm done with it
False! Always close files after you are done.
List 5 common data types
Any of the following
int, char, float, double, bool, string, short
Who is your TA? Where and when is his office hours?
s
True or False
Array size can be changed at run-time
False! Arrays are set at compilation and cannot be changed at run-time.
True or False: this code will work
int number = 1;
while (number < 10)
{
court << number << endl;
};
False! Number never got incremented.
Will this throw an error?
int main()
{
fout.open("example.txt");
// Validate File is open
if (!fout.is_open())
{
cout << "Failed to open file" << endl;
return -1;
}
fout << "Hello World" << endl;
fout.close()
return 0
}
YES! It is missing the initialization of fout.
Is this a correct initialization?
char x = 'abc';
No, chars can only be a single digit.
List two from three of my hobbies
Cooking, Gym, Travel
What does "sizeof(arr)/sizeof(int)" equal to?
The length of the array!
How many iterations will this code run for (int i = 0; i <= 10; i++) {};
11! 0 up to including 10
Name both libraries for regular IO and file IO
<iostream> & <fstream>
Float vs Double whats the difference?
Floats take up less memory and space but are less accurate than doubles
Doubles are way more accurate than floats but take more memory and space.
List 3 of 5 places that I visited from the slides.
Manhattan, NYm Watkins Glen State Park, Niagra Falls, Magic Kingdom, Eagle Rock