1 / 14

CS 1428 Exam I Review

CS 1428 Exam I Review. Exam Format. 90 Total Points 40 Points Writing Programs 25 Points Tracing Algorithms and determining results 10 Points Short Answer 20 Points Fill in the Blank All point totals are approximations Similar to programming assignments and programs from lecture.

ronj
Download Presentation

CS 1428 Exam I Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 1428 Exam I Review

  2. Exam Format • 90 Total Points • 40 Points Writing Programs • 25 Points Tracing Algorithms and determining results • 10 Points Short Answer • 20 Points Fill in the Blank • All point totals are approximations • Similar to programming assignments and programs from lecture

  3. Example Programming Problem • Write a program that reads a number of golf scores followed by that number of scores from a file named “scores.txt” Total the scores as you read them in and print out the average score to the screen. (Note: This problem is more difficult than the problems on the exam.)

  4. 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: " << foo2 << endl;

  5. Example Short Answer • Why is it a bad idea to compare two floating point numbers (e.g. doubles) with the equals (==) operator?

  6. Chapter 1 • 0 points • 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 • Important stuff, but not covered on the exam

  7. Chapter 2 • 50 Points • Variables and Identifiers • Valid identifiers • Data types • Integer types • Floating Point types • Characters • Boolean • Assignment • Arithmetic Operators • Make sure you understand the mod(%) function

  8. Chapter 3 • 30 Points • cin • With prompts • Mathematical expressions • Order of precedence • Combined operators (e.g. += and ++) • static_cast • Constants • Mixed mode operations (mixing floats and ints) • File input and output

  9. Chapter 4 • 25 Points • Relational operators • Truth tables • Logical operators && || ! • if statements • if-else • if-else-if

  10. Functions • 15 Points • Know how to write a function • Header (signature) • Parameters • Return statement • Know how to call a function • Know how to use the return value

  11. Loops • 10 Points • Understand the “for” loop • Initialize, conditional, update • Body of the loop • Review the programs that use loops

  12. 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.

  13. What to bring • Pencils and erasers • We will provide scratch paper • No calculators

  14. Questions

More Related