120 likes | 150 Views
CS 1428 Exam I Review. Exam Format. 130 Total Points 40 Points Writing Programs 30 Points Tracing Algorithms and determining results 20 Points Short Answer 35 Points Fill in the Blank Similar to quizzes and programming assignments. Example Programming Problem.
E N D
Exam Format • 130 Total Points • 40 Points Writing Programs • 30 Points Tracing Algorithms and determining results • 20 Points Short Answer • 35 Points Fill in the Blank • Similar to quizzes and programming assignments
Example Programming Problem • Write a program that reads a floating point number representing the side of a square from a file named “test.txt” and prints out the area of the square formatted to five decimal places.
Example Tracing Problem • What will the EXACT output of the following program be? int foo = 9; string str = "Hey!"; float foo2 = 5.7; foo2 = foo - foo2; if (foo > foo2) cout << "Hello!"; else if (foo < foo2) cout << foo2; else cout << foo; cout << endl; cout << "foo2 is: " << fixed << setprecision(1) << foo << endl;
Example Short Answer • Approximately how many 12KB pictures could I put in my 10MB flash memory?
Chapter 1 • 25 points • Binary numbers • Conversions to/from base 10 • Simple addition and subtraction • No 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 • 50 Points • Variables and Identifiers • Valid identifiers • Data types • Integer types • Floating Point types • Characters • Boolean • Assignment • Arithmetic Operators
Chapter 3 • 30 Points • cin • Mathematical expressions • 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 • 25 Points • Relational operators • Truth tables • Logical operators && || ! • if statements • if-else • if-else-if
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