How To Study For A C++ Test.

To make a long story short I am in an introductory C++ programming class. The textbook we use is C++ For Engineers, And Scientists By Gary J. Bronson. So far in the class we have covered are data types, cin, cout, cmath stuff, if-else statements, and loops. Since this is my first computer programming class I am wondering how I should study for the test.
I imagine one big thing will be syntax. For my early classes, part of the tests were to note every syntax error in a piece of code.

For data types, I would be familiar with the size of each one, as well as the sizeof function. You want to know which the types are signed, and possibly the min/max of that type. The max of a unsigned char is: 255 = 2^8 - 1. The number 8 comes from the amount of bits in an unsigned char.

if/else and loops you will just have to know how they work, as well as their syntax.

cin is an input stream buffer and cout is an output stream buffer. Thats all we had to memorize for our first test.

I imagine you might get something like this:
1
2
3
4
5
6
7
int i = 0;
while (i < 24)
{
  if (i % 2 == 0)
    cout << i << endl;
  i += 3;
}


And then be asked what gets printed to the screen.

Edit, or maybe if your teacher is tricky
1
2
3
4
5
6
7
int i = 0;
while (i < 24)
{
  if (i % 2 == 0);
    cout << i << endl;
  i += 3;
}
Last edited on
Topic archived. No new replies allowed.