60 likes | 156 Views
COMP1180 Review. Date: 4 March, 2009 Time: 10:30am - 12:20pm Venue: CS students -- FSC801C and FSC801D IS and other students -- OEE1017 Remarks: 1) Closed book & closed notes 2) The test will be taken in written test format
E N D
COMP1180 Review Date: 4 March, 2009 Time: 10:30am - 12:20pm Venue: • CS students -- FSC801C and FSC801D • IS and other students -- OEE1017 Remarks: • 1) Closed book & closed notes • 2) The test will be taken in written test format • 3) Covers everything up to recursive function • 4) Take alternate seat and work on your own • 5) Bring a calculator if you want (optional)
COMP1180 Review Assessment: 10% of the Grade Total Marks: 100 Expected Time to Finish: 100 Min. Format: • Short Questions on Programming and C Syntax (~20%) • Understanding the Program (~20%) • Program Tracing and its Output (~30%) • Function Writing (~30%)
COMP1180 Review Class Notes from the Text Book: • 02 - Introduction to C Programming • 03 - Structured Program Development • 04 - C Program Control • 05 - Functions Supplementary Notes from Prof. Joseph Ng • S02-printf_scanf.ppt • S03-C_Language.ppt • S04-Structured_Programming.ppt • S05-Functions.ppt All Lab Sheets from Lab1 to Lab5 (excluding Lab 0 & Lab3a)
COMP1180 Review Variables • Data Types – char, int, float, double • Variable Types – global, local, static, const • Naming, Declaration, and Initialization • Qualifiers – short, long, signed, and unsigned (skipped) Formatted input and output – scanf( ), printf( ) Assignment statements • Arithmetic operators: +, -, *, /, % • Precedence, associativity and integer division • Relational operators: >, >=, <, <=, ==, != • Logical operators: &&, || • Type conversion • Increment and decrement operators: ++, --, i++ vs. ++i • Assignment operators: +=, -=, *=, /=, %= • Conditional operators: expr1 ? expr2 : expr3 (skipped)
COMP1180 Review Control flow • Statements and Blocks • IF statements • if (expression) statement; • if (expression) statement1; else statement2; • If (exp != 0) vs. if (exp) • Nested IF statements • SWITCH statement • Default, break and switch vs. if • Loops • WHILE loop • FOR loop • DO WHILE loop • Nested loops • break and continue within a loop • goto and labels (skipped)
COMP1180 Review • Arrays • One-dimension array – int A[20]; • Declaration, initialization, accessing array elements • Multi-dimension array – int connect[18][18]; • Declaration, initialization, accessing array elements • Character arrays – char s[10] ; • End-of-string character (‘\0’); • Functions • Return-type Function-name (Parameter List) • Function Prototype, Function Definition, and Function Call • Parameters vs. Arguments and Formal vs. Actual arguments • The return statement and type conversion • Scopes of variables: local vs. global vs. parameters vs. static • Call by values • Call by reference (skipped) • Recursive functions