MCC - CIS162AB - C++ Level I
Study Guide for Test 1
   cpp.gif

Completion of the study guide is NOT required, so it will not be turned in or submitted electronically. However, completing the study guide will help students prepare for the exam. In addition, the completed study guide may be used on the actual exam, because exams are open book and notes. If you can't find the answer to any of the questions, please feel free to ask your classmates and/or instructor.

Introduction to Programming and C++:

What is pseudocode?



What is an algorithm?



What is the input and output(s) of the compiler?



What is the input(s) and output(s) of the linker?



What are the three categories of errors that can be made by a programmer?



What type of errors can a compiler detect?



How are run-time errors usually discovered?



What errors must the programmer detect and correct during testing?



What is a prompt line?



What is meant by "echoing the input"?



What are the 4 control structures covered in this course?






What C++ commands are associated with each of the 4 control structures?







How are comments symbols // and /* */ different?



What is the purpose of including comments in a program?



What are some of the things a debugger allows a programmer to see?




Variables and Data Types:

What are the different data types?



What kind of data can be stored in each of the variable types?



Why do we use meaningful naming conventions for variables?



Are variable names case sensitive?



What is variable initialization, and how can it be done in C++?



What are constant variables used for, and what is the preferred naming convention?



What type of variables should use the const modifier?




Console Output:

What special character is used to define an escape sequence?



What do the escape sequences \n and \t do?



What is endl used for?



What does the "magic formula" for formatting output do?




Math Operators:

What are the precedence rules?



How do the parentheses affect the precedence rules?



What can be lost from the result of integer division?



What does the modulus operator % return?



What is the syntax to increment a variable by one using assignment statements, short hand notation, and incrementors?



What is the syntax to decrement a variable by one using assignment statements, short hand notation, and decrementors?



What would the following statement do to the variable num?
num += -1;



Boolean, If Statements and Loops:

What values are Boolean expressions evaluated to?



What is the difference between the = and = = symbols?



What is the difference between AND and OR comparison expressions?



What are the symbols for the AND and OR operators?



What is the Not operator, and how does it effect the Boolean expression?



What is the difference between if and if-else statements?







How does the compiler match an else with an if statement?



Does the compiler take indenting you use into consideration to match else and if statements?



What is the purpose of indenting if-else statements?



How can braces be used to prevent the dangling-else problem?



What are differences between the while and do-while loops?





What causes an infinite loop?




Functions:

What is involved in top-down design?



What is the purpose of structure charts?



What is depicted in a structure chart?



How are structure charts different from flowcharts?



Why is the black box analogy used to describe how functions should be written?



Why are functions considered small programs (hint: input,process, output)?



What is the purpose of precondition and postconditions (documentation)?



Does the compiler require preconditions and postconditions?



What is the difference between formal parameters and arguments?



When do we use formal parameters?



When do we use arguments?



What is the purpose of the function prototype?



Why must the data types of parameters and agruments match?



Why is it that the function prototype provides all of the information needed to write the function call?



What is considered the function call?



What is included in the header of a function definition?



What is included in the body of a function definition?



What does the return statement do in the function?



How many return statements can be in a body of a function?



How many values can be returned through the return statement?



What is the main difference between void and other return types?



Why would you want a function that doesn’t return a value?



What is the syntax for the return statement in void-functions?



Can functions call functions that call other functions?



What is passed to the function through a call-by-value parameter?



What is passed to the function through a call-by-reference parameter?



In a call-by-reference mechanism, how many values can be “returned” through the parameters?



Can call-by-value and call-by-reference parameters be mixed?



How are function names overloaded?



When function names are overloaded, how are they uniquely identified?



What is a function's signature consist of?





Variable Scope:

Where are global variables defined?



Where are local variables for main defined?



Where are local variables for other functions defined?



Are the variables listed in the function header declared as local variables of the function?



When various functions declare variables of the same type with the same name, are they considered global variables?



How is block of code defined?



Can local variables be declared in a block of code?



What is a variable's scope?




Pointers:

What are pointer variables?



How is a pointer variable declared (*)?



What value does the & in front of a regular variable provide?





Revised: 06/01/2007 - www.mc.maricopa.edu/~marquez/cis162ab/study_guide1.html