Not complete but good to work on!
These will not be collected, but you can certainly discuss
them with your classmates or your TA or Dr. Keen.
- Do you know the difference between input and output, the
difference between RAM and a hard drive, and
what is a path? What's the difference between a text file and an exe file?
-
Name as many C++ libraries as you can, and list the functions or operations from each that you use.
-
Write down three legal identifiers. Can you state why each one is legal?
Try to use all the rules of identifier creation.
Write three invalid identifiers; make each one invalid in a different way.
- What does 'case sensitive' mean?
-
How do you declare a variable? Where do you declare a variable? Why do you declare a variable? How do you initialize a variable? How do you declare a global variable?
- What happens when you declare a variable?
-
How do you declare a named constant? Where do you declare it? Why do you declare it?
-
What's the difference between a named constant and a variable?
What are the similarities?
- What's special about the main function?
-
Write an assignment statement that has the formula below stored in a variable called result. Use no more parentheses than needed.
a + b - 4 e - f
2 a
- Trace this code: Mark statements which contain type coercion.
Rewrite the statements so they use type casting.
float v1, v2;
int v3;
v1 = 15.7;
v3 = 3 * 9.2;
v2 = v1 + v3;
v3 = v2 - 15;
v1 = 17;
v2 = 3 * v1;
-
Trace this code: Remember that means to show RAM and output areas.
int a, b, c, x, y;
b = 7;
x = 5;
y = x * 15;
cout << b << x << y;
a = 3 * b + 9;
x = y + 3;
y = x;
cout << b << x << a << y;
a = 5 * b;
- Calculate the values of the expressions. Indicate what type the answer is.
a. 5 + 4 * (3.2 + 4.5)
b. 7 % 5 + 12 / 7
c. 8 + pow( 4.0, 3)
- Trace this code:
int x = 7;
cout << " x " << x << endl << endl << endl << "*****" << "endl"
<< endl << endl;
cin >> x; // assume the user types 23 and presses enter
cout << " x " << x << endl;
-
Describe how a compiler works. What jobs does it do for you? what will it not do for you?
-
Alice uses objects and methods and functions. Can you tell the difference between them? What's an event? What's an instance?
-
What is the value of a and b after this code?
float y = 2.3;
int a, b;
a = (int) y * 2;
b = y / 2;
-
Write a complete program that performs the interaction given. The user enters a number of dollars and the program tells how many pennies that is. Use at least one variable and one named constant.
-
Name the properties of a variable (or piece of data), the four that we discussed in class.
-
What's the difference between syntax and semantics?
How do you find syntax errors? semantics errors?
-
Describe John von Neumann's contribution to computers.
Why is it important to today's computers?
- List the parts of the IDE that you have used so far. What did you
use each one for?
-
We used Alice to illustrate the control structures of structured programming.
What are they and how do they work? can you name a data structure or two?
- What is "dead code"?
What is an "infinite loop"? What is "spaghetti code"?
- Comments - how do you write them? why do you write them? who reads them?
-
Name the different data types in C++. How are they different? what are they used for? What do constants of each type look like?
- Who is Bjarne Stroustrup? Dennis Ritchie?
- Why do we care about the C++ language standard?
- Describe precisely the actions that happen when an assignment statement
is executed. That is, what happens first? second? last?
- Name some pre-written functions. What type do they require for
arguments? what type do they return?
- Show the output of this code.
x = 19;
if (x > 15)
cout << "blue";
else
cout << "white";
if (x < 7)
cout << "green";
cout << "red";
- Describe a 'single step'. Where do you use it?
- Describe pseudocode. When is it written?