CS 1428 Final Exam Review
Exam Format 200 Total Points 60 Points Writing Programs 45 Points Tracing Algorithms and determining results 20 Points Short answer 75 Points Multiple choice Similar to prior exams, quizzes and programming assignments Material since last exam will have more weight
Example Programming Problem Write a function named findBiggest that takes an array of integers and the number of integers in the array and returns the largest integer in the array.
Example Tracing Problem What will the EXACT output of the following program be? int foo = 9; string str = "Hey!"; float foo2 = 5.7; while (foo2 < foo) { if (foo2 > 3.14) { cout << str << “ bigger than PI!” << endl; foo -= 2; } else cout << foo << “loser” << endl;
Example Short Answer Why do we need function prototypes before the main function?
Chapter 1 20 points Types of errors Binary numbers Terminology Conversions to/from base 10 Simple addition and subtraction Conversion to/from 2’s complement Terminology Bits, bytes kilo, mega, giga, tera What do they mean? Machine language, assembly language, high- level language Von Neumann architecture Problem solving process Types of errors
Chapter 2 ?? Points Variables and Identifiers Assignment Valid identifiers Data types Integer types Floating Point types Characters Boolean Assignment Arithmetic Operators
Chapter 3 10 Points cin Mathematical expressions static_cast Constants Order of precedence Combined operators (e.g. += and ++) static_cast Constants Formatted output Mixed mode operations (mixing floats and ints) File input and output
Chapter 4 35 Points Relational operators Truth tables if statements Logical operators && || ! if statements if-else if-else-if
Chapter 5 40 points Definite vs. indefinite iteration while loops Body of the loop Loop guard Infinite loops for loops Initialization Condition Progression Reading from an input file Read until EOF sentinel value Known size
Chapter 5 (cont.) Nested loops Off-by-one errors Understand the MathStuff and ATM programs do-while statement will not be on exam
Chapter 6 50 Points Functions Prototypes Definitions Function calls Parameter lists Return types return statement Parameters Difference between “formal” and “actual” Pass by value and pass by reference Overloading methods Look at the “signatures” Using arrays as parameters to functions
Chapter 7 50 Points One-dimensional arrays Printing all the elements Declaration Assignment Using arrays as parameters Printing all the elements Finding the average of numeric elements Climate program Searching and Sorting Know what they are. Linear search
Machine Organization 10 Points von Neumann architecture Stored program concept Remember the diagram Execution cycle Fetch-decode-execute How is information represented? integer character floating point
How to Study Rewrite all the programs. Redo labs. Exam programming questions will be similar to assignments. Redo labs. Learn by doing and recognizing patterns. Don’t stay up late!! Get some sleep and eat a good breakfast.
What to bring Pencils and erasers We will provide scratch paper No calculators
Questions