1 / 6

COMP1180 Review

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

dawn-mack
Télécharger la présentation

COMP1180 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. 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)

  2. 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%)

  3. 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)

  4. 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)

  5. 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)

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

More Related