e01 : Midterm-1 Exam
num | ready? | description | exam date |
---|---|---|---|
e01 | true | Midterm-1 Exam | Wed 04/26 02:00PM |
Instructions for the exam
- You may bring one 8.5” x 11” piece of paper with notes on 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
Post exam information
Reference material
You are expected to know the material from the following lectures, labs and homeworks:
- Lecture 1 to lecture 7 , including all code implemented in class, midterm will exclude test driven development in lecture 7 but will include the nested for loop examples covered in that lecture
- Homework 1 to 6 (you may view all your graded homeworks on gradescope, ask your mentor if you have questions)
- Labs 0 to 2
-
Please go over the code written in class: https://github.com/ucsb-cs16-sp17/lectures
- Solution to HW 1
- Solution to HW 2
- Solution to HW 3
- Solution to HW 4
- Solution to HW 5
- Solution to HW 6
Practice problems
In addition to all the homeworks, labs and lectures, you may use the problems in the following document to practice:
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.
- The exam quation paper is available here: Midterm-1 WI17
- Exam statistics: The mean of the exam was 85.57%, standard deviation 9.68%. Highest score 100%
- Spring’10
- Winter’10
- Fall’09
Midterm 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
- Simple unix commands (covered in labs): cp, mkdir, ls, pwd, cd
- An understanding of what compilers are, the compilation and execution process of C++ programs:
- What is g++? What are the inputs and outputs ?
- What is the difference between compiling and running a C++ program?
- How can you ask g++ to use the c++11 libraries when compiling your C++ program
- What are compile-time errors?
- What are run-time errors?
-
How to pass arguments to main refer to labs that used this concept
-
While loops, for loops, do while loops (very important)
- 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 valid and invalid ways to name variables in C++ - Please refer to book on this
- Identify invalid use of variables: For example using a variable in an expression or assignment before declaring it
- Different ways of initializing variable:
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 occurance of infinite loops
- Write, evaluate and simulate the run-time behavior of C++ expressions
- Operator precedence (You don’t have to learn the precendence 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 as practiced on homeworks
- What evaluates to true? What evaluates to false?
- Debugging: Given a C++ program, identify and correct:
- Compile-time and run-time errors
- Incorrect program behavior