e01 : Midterm exam - I
num | ready? | description | exam date |
---|---|---|---|
e01 | true | Midterm exam - I | Thu 10/25 02:00PM |
Topics Covered
- Homework 1 to Homework 3
- Lab 0 to Lab 2
- Lectures up until the exam
Study Guide
- Write the skeleton of a simple C++ program - see the hello world example covered in lecture
- Write code that involves passing parameters to main
- Read and write to standard input, output with cin, cout - you should be able to write code that uses these concepts, identify the difference between cout, exit and return
-
Floating point arithmetic and integer arithmetic
-
While loops, for loops, do while loops (very important)
-
Number representation and base conversion
- Functions
- An understanding of how parameters are passed to functions, and how values are returned from a function
- Difference between function that prints to output and function that returns a value
- Function declaration, definition and call
- Writing functions similar to those in the labs
- The ability to use variables and basic data types in the type of programs covered in class:
- Identify invalid use of variables: For example using a variable in an expression or assignment before declaring it
- Different ways of initializing variables:
int x =10; int x(10); cin>>x;
- Difference between variable declaration and initialization.
- What is the default value given to uninitialized variables in C++ and why this can be a problem
- The ability to debug and write code that involves flow control structures taught in class and used in labs. Pay attention to syntax, and the ability to use each appropriately to solve problems similar to those provided in the labs
- If else statements, multiway if-else statements
- For, while and do-while loops, nested for loops (used in lab02)
- Identify the occurrence of infinite loops
- Write, evaluate and simulate the run-time behavior of C++ expressions
- Operator precedence (You don’t have to learn the precedence table, you should just know how to apply it to evaluate expressions)
- Assignment statements and assignment operator used within an expression
- Evaluate compound Boolean expressions
- What evaluates to true? What evaluates to false?
Instructions for the exam
- You may bring one handwritten 8.5” x 11” piece of paper with notes both sides. This paper will be collected along with your exam, so make your own copy if you would like to keep it.
- No calculators or phones are allowed in the exam
- No other notes or books are allowed
- There are no makeups for this exam
- You must write your name on every single sheet of paper including your notes
- We will provide you with scratch paper
- We will provide you the table of operator precedence
Homework solutions
Past exams
You may also refer to all the past exams. Please note that some questions on these exams may refer to labs that you have not completed so far. You will only be asked questions related to the labs you have completed. The past exams should however provide some information on the expected difficulty and approximate format of the exam. Please note that there may be differences in content as well.