Midterm Topics
This is a list of the topics we have covered so far.
The midterm questions can come from any of these.
Read over the notes and review the readings mentioned in them (if any).
Study the example code.
-
Variables
Know the four properties of a variable, name, type, location and contents.
Know the different data types, int, float char, double, long, bool etc.
-
Control Flow
If statements with and without else.
For, while and do loops.
Remember that is there are multiple statements in a loop or if you need braces.
-
Functions
Functions can be used wherever a variable of the return type can be used.
Look at the functions example code using bigger() and smaller().
Know the difference between pass by value and pass by reference (reference parameters).
There can be any number of arguements to a function including zero.
Functions can return only one value.
-
Expressions
Know the different operators ( <, >, >+, <=, != ) know the
logical operators ( !, &&, || ) How to combine them.
What is true and what is false?
-
Arrays
Now how to declare and use one dimensional arrays.
Array elements are all the same size.
Arrays cannot be expanded.
-
Strings
Arrays of characters.
A '\0' marks the end of the string and comes after the last character.
If there are 6 characters in the string, how long does the array have to be?
A string can be shorter than the array it is in.