Midterm Review

  • Covers lectures 1-17. The related chapters of the textbook are 1, 2, 3, 4, 5, and 6.5 of AG.
  • List of topics:
  • program structure for C# console applications
  • keywords, white space, comments
  • basic input/output
  • C# data types
  • data types
  • range and precision of data types
  • input/output of simple data types: Parse() methods
  • arithmetic operations
  • data conversion
  •  4/5 = 0 while 4.0/5 = 0.8 and (double)4/5 = 0.8
  • implicit conversion, cast, see examples of Lecture 6
  • assignment operations
  • increment and decrement operators
  • boolean operations
  • logical and conditional operators
  • operator precedence
  • a summary of all operators can be found in the last slide of Lecture 7.
  • flow of control
  • conditional statements
  • if and if/else statements
  • C# ternary conditional operator
  • switch statement
  • loop statements
  • while, do/while, and for statements
  • break/continue statements
  • writing, choosing, and understanding loop programs, e.g.
  • loop-and-a-half idiom
  • methods
  • method definitions
  • overloading and signature
  • argument promotion
  • variable scope and duration
  • pass-by-value and pass-by-reference (ref and out)
  • see lectures 13, 14 (basic concept, difference between ref and out)
  • decomposition and stepwise refinement (Calendar.cs)
  • classes
  • objects and classes
  • encapsulation
  • access modifiers
  • random number generation