CS 1428 Exam II Review
Exam Format 110 Total Points 60 Points Writing Programs 30 Points Tracing Algorithms and determining results 20 Points Short Answer Similar to quizzes and programming assignments
Example Programming Problem Write a function named getBigger that takes an integer parameter, prompts the user for a number, and then returns the higher of the two numbers.
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?
Everything from Ch1-4 Need to know everything from first exam
Chapter 5 45 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 55 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
Machine Organization 20 Points Execution cycle 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. 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