mid-review2

mid-review2 - COMP 102 Midterm Review 1 Tips Eat a light...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Midterm Review COMP 102
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Tips Eat a light meal before the exam NO electronic devices (including calculators, dictionaries, phones, pagers, etc.) Exam time 6:30 -8:30pm. But come a little early to find your seat assignment!
Background image of page 2
3 02 Prog Fundamentals I: Midterm Review /Slide 3 Seating Plan Lecture Theater A: L2, L4 Lecture Theater B: L1, Lecture Theater C: Lab3a, Lab3b Lecture Theater E: Lab3c, Lab3d
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Know INTRODUCTION TO COMPUTER SYSTEMS DATA TYPES, VARIABLES AND CONSTANTS Data types Identifiers, variables and constants Type casting
Background image of page 4
Know STRUCTURE OF C++ PROGRAMS Compiler directive #include I/O operators cin & cout Assignment statements Expressions, operators and operator precedence SELECTION STRUCTURES Relational and logical operators Logical expressions If, if-else, if-else-if , and nested if statements Dangling else switch statement
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Know LOOPS for loops while loops do-while loops Increment and decrement operations Nested loops PROGRAM DESIGN AND FUNCTIONS Top-down design and stepwise refinement Function prototypes and function definitions Parameter Passing: pass-by-value, pass-by- reference
Background image of page 6
Watch Out For Programming style problems indentation Nested Loops [EX 1] for(a = 1; a < 10; a++){ for(a =1; a < 10; a++) cout << a; // what happens here? }
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 02 Prog Fundamentals I: Midterm Review /Slide 8 C++ Data Type A type defines a set of values and a set of operations that can be applied on those values. The set of values for each type is known as the domain for the type. C++ contains 5 standard types: v o i d i n t c h a r f l o a t b o o l S t a n d a r d D a t a T y p e s
Background image of page 8
9 02 Prog Fundamentals I: Midterm Review /Slide 9 Identifiers appear in black in Visual C++. An identifier is a name for a variable, constant, function, etc. It consists of a letter followed by any sequence of letters, digits, and underscores. Examples of valid identifiers: First_name, age, y2000, y2k Examples of invalid identifiers: 2000y Identifiers cannot have special characters in them. For example: X=Y, J-20, ~Ricky,*Michael are invalid identifiers. Identifiers are case-sensitive. For example: Hello, hello, WHOAMI, WhoAmI, whoami are unique identifiers. C++ identifiers
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 2 Prog Fundamentals I: Midterm Review /Slide 10 Constant declarations Constants are used to store values that never change during the program execution. Using constants makes programs more readable and
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/07/2011 for the course COMP 102 taught by Professor Daniel during the Spring '08 term at HKUST.

Page1 / 35

mid-review2 - COMP 102 Midterm Review 1 Tips Eat a light...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online