Arrays
Loops
IO and file IO
Data Types
William and Faculty
100

True or False

One array can store more than one data type

False

100

When would you use for loops over while loops?

When you know how many times it will execute!

100

What is the name of this operation ">>"?

Extraction Operator
100

True or False

unsigned data types have more numbers than signed data types

False, they have the same amount of numbers.

100

When and where is my office hour?

Wednesday 10:00 - 11:00 Oldmain 2050

200
Are arrays mutable

Yes!

200

When would you use while loops over for loops?

When you are unsure the number of times of execution!

200

What is the name of this operator "<<"?

 Insertion operator!

200

True or False

a char variable has an number value

True, it has ASCII values!

200

When and where is my next SI Session?

Thursday Aug, 29 6:20-7:35 Old main 2050

300

What is the square bracket '[]' operator used for?

Access an element at a specific index!

300
What happens in statement 2 for (statement 1, statement 2, statement 3) {};?

Checks condition for executing the code block

300

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.

300

List 5 common data types

Any of the following

int, char, float, double, bool, string, short

300

Who is your TA? Where and when is his office hours?

s

400

True or False

Array size can be changed at run-time

False! Arrays are set at compilation and cannot be changed at run-time.

400

True or False: this code will work

int number = 1;

while (number < 10)

{

     court << number << endl;

};


False! Number never got incremented.

400

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.

400

Is this a correct initialization?

char x = 'abc';

No, chars can only be a single digit.

400

List two from three of my hobbies

Cooking, Gym, Travel

500

What does "sizeof(arr)/sizeof(int)" equal to?

The length of the array!

500

How many iterations will this code run for (int i = 0; i <= 10; i++) {};

11! 0 up to including 10

500

Name both libraries for regular IO and file IO

<iostream> & <fstream>

500

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.

500

List 3 of 5 places that I visited from the slides.

Manhattan, NYm Watkins Glen State Park, Niagra Falls, Magic Kingdom, Eagle Rock