Home › SparkNotes › Computer Science Study Guides › Review of C++ Fundamentals › Review Test
This page requires JavaScript, which you don't seem to have. Please try a different browser.
Scroll through the page to review your answers. The correct answer is highlighted in green. Your incorrect answers (if any) are highlighted in red. If you'd like to take the test over again, click the reset button at the end of the test.
Data members are usually private and member functions public because
Member functions are generally used to manipulate
Whitespace consists of all of the following, except
The assignment operator =
To complete high precision operations involving the first 20 digits of pi, you would most likely use which of the following data types?
Which of the following will print out: a c b d
91 % 7 evaluates to
Which of the following statements will not affect the value of x?
If you create a class called bird and you want an instance of it, say object robin, to fly, then the command might look like:
Relational operators compare 2 ____ values and evaluate to a ____.
Which for-loop will run a variable from 5 to 105 in steps of 4?
Which expression will cause the while-loop to loop until x equals 1 or init is not 'g'?
A do-loop is different from a while loop because
Which statement checks that the character dig falls between the characters '1' and '9'?
An object usually interacts with the rest of the program via
In a nested for-loop structure, the break command will take you out of the loop it is in, but will not take you out of any of the other loops.
You want to display "too short" if height is less than 4 and "okay" otherwise. Your best choice is to use a(n)
If you type obj1=obj2;, the compiler
Function arguments are used to
To tell a car object variable to speed up by 10 mph, you might
The return statement tells a function to
To use the sqrt() function defined in header file math.h, you must write
To create an array of 10 elements of type int, you would write
The last element in an array of 50 elements is
To loop through an array of size 6, a proper for-loop statement would be
To initialize a one dimensional array to contain the numbers 1 through 6, you would write
In a three dimensional array declared box[2][3][5], the last element is
Linked lists
Arrays can hold
If x is initially 5, then array[--x] will access which element of array?
The keyword const ensures a variable
Creating a struct
Structs are used to create new data types.
To access a struct pointer's data, you use which operator?
Enumerated type values are really represented as integers.
The keyword enum is used to create a
A function definition differs from a function declaration in that it
A member function defined within a class is
Overloaded functions are useful when two or more functions do roughly the same task but with different data types
Default arguments can
Constructors' arguments must all have default arguments.
A static member variable is shared by all objects within the class.
Destructors
To use a public base class function f(), you can use the statement
To allow derived class functions to access private base class data, you must
If a base class has a constructor, then its derived classes must define one also.
If class der is derived from class base, then der's public member functions can
Composition is
Composition is a good way to avoid complications of multiple inheritance.
If you make a new object with pointer = new aClass, and then use the aClass member function func() with the new object, you would write:
Remember me
Liven up your study sesh with one of these playlists!
Enjoy the tunes! This expertly-crafted playlist is brought to you by
Take this quiz to find out!
We've got the answers!
Click to find out!
Have you seen this yet?
These. Are. Hilarious.
Travel back in time!
From super cute to super bad!
What do you think?
Leave your thoughts here!
What did Star Trek get wrong?