CS 1101 Programming Methodology http www comp nus

  • Slides: 59
Download presentation
CS 1101: Programming Methodology http: //www. comp. nus. edu. sg/~cs 1101/

CS 1101: Programming Methodology http: //www. comp. nus. edu. sg/~cs 1101/

Week 1: Introduction § Chapter 0: Introduction to Computers and § § Programming Languages

Week 1: Introduction § Chapter 0: Introduction to Computers and § § Programming Languages Binary numbers High-level programming languages Useful problem-solving strategies. Writing algorithms in pseudo-codes. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 2

Chapter 0: Introduction to Computers and Programming Languages § From Thomas Wu’s book. §

Chapter 0: Introduction to Computers and Programming Languages § From Thomas Wu’s book. § Please read up on your own. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 3

Computers as Information Processors (1/2) § Computer = Hardware + Software. v Hardware: physical

Computers as Information Processors (1/2) § Computer = Hardware + Software. v Hardware: physical components for computation/processing; should be simple, fast, reliable. v Software: set of instructions to perform tasks to specifications; should be flexible, user-friendly, sophisticated. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 4

Computers as Information Processors (2/2) Computer are Information Processors Raw data Computer system Processed

Computers as Information Processors (2/2) Computer are Information Processors Raw data Computer system Processed information Data Units: 1 bit (binary digit): 0 or 1. 1 byte: 8 bits. 1 word: 1, 2, or 4 bytes, or more (depends on computer). © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 5

Components of a Computer (1/2) § Main Components: v Processor (controls devices and processes

Components of a Computer (1/2) § Main Components: v Processor (controls devices and processes data). v Memory: stores programs and intermediate data. v Input Devices: accept data from outside world. v Output Devices: presents data to the outside world. § An analogy with Human Information Processors: v Processor – brain’s reasoning powers v Memory – brain’s memory v Input Devices – eyes, ears, sensory sub-system v Output Devices – mouth, hands, facial and body expressions © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 6

Components of a Computer (2/2) Headphone (Output) Monitor (Output) Hardware box (contains processor, memory,

Components of a Computer (2/2) Headphone (Output) Monitor (Output) Hardware box (contains processor, memory, buses etc. ) Mouse and Keyboard (Input) © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 7

Decimal Number System n n n § Also called the base-10 number system. 10

Decimal Number System n n n § Also called the base-10 number system. 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. In general, (anan-1… a 0. f 1 f 2 … fm)10 = (an x 10 n) + (an-1 x 10 n-1) + … + (a 0 x 100) + (f 1 x 10 -1) + (f 2 x 10 -2) + … + (fm x 10 -m) Weighting factors (or weights) are in powers-of-10: … 103 102 101 100. 10 -1 10 -2 10 -3 10 -4 … § Example: 593. 68. The digit in each position is multiplied by the corresponding weight: 5 102 + 9 101 + 3 100 + 6 10 -1 + 8 10 -2 = (593. 68)10 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 8

Other Number Systems § Binary (base 2): weights in powers-of-2. ¨ Binary digits (bits):

Other Number Systems § Binary (base 2): weights in powers-of-2. ¨ Binary digits (bits): 0, 1. ¨ Essential in computing. § Octal (base 8): weights in powers-of-8. ¨ Octal digits: 0, 1, 2, 3, 4, 5, 6, 7. § Hexadecimal (base 16): weights in powers-of 16. ¨ Hexadecimal digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. § Base R: weights in powers-of-R. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 9

Base-R to Decimal Conversion § (1101. 101)2 = 1 23 + 1 22 +

Base-R to Decimal Conversion § (1101. 101)2 = 1 23 + 1 22 + 1 20 + 1 2 -1 + 1 2 -3 = 8 + 4 + 1 + 0. 5 + 0. 125 = (13. 625)10 § (572. 6)8 = = § (2 A. 8)16 = = § (341. 24)5 = = © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 10

Decimal to Binary Conversion (1/2) § Whole number: repeated division-by-2 method. § To convert

Decimal to Binary Conversion (1/2) § Whole number: repeated division-by-2 method. § To convert a whole number to binary, use successive division by 2 until the quotient is 0. The remainders form the answer, with the first remainder as the least significant bit (LSB) and the last as the most significant bit (MSB). (43)10 = (101011)2 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 11

Decimal to Binary Conversion (2/2) § Fractions: repeated multiply-by-2 method. § To convert decimal

Decimal to Binary Conversion (2/2) § Fractions: repeated multiply-by-2 method. § To convert decimal fractions to binary, repeated multiplication by 2 is used, until the fractional product is 0 (or until the desired number of decimal places). The carried digits, or carries, produce the answer, with the first carry as the MSB, and the last as the LSB. (0. 3125)10 = (. 0101)2 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 12

Mathematics § A-level Mathematics assumed. § Common concepts encountered in § programming: prime numbers,

Mathematics § A-level Mathematics assumed. § Common concepts encountered in § programming: prime numbers, complex numbers, polynomials, matrices. Mathematical maturity desirable. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 13

Software (1/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming

Software (1/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming language ¨ n Sequence of instruction that tells a computer what to do Language for writing instructions to a computer Major flavors Machine language or object code ¨ Assembly language ¨ High-level ¨ © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 14

Software (2/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming

Software (2/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming language ¨ n Sequence of instruction that tells a computer what to do Language for writing instructions to a computer Major flavors Machine language or object code Program to which computer can ¨ Assembly language respond directly. Each instruction ¨ High-level ¨ is a binary code that corresponds to a native instruction. Example: 0001001101101110 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 15

Software (3/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming

Software (3/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming language ¨ n Sequence of instruction that tells a computer what to do Language for writing instructions to a computer Major flavors Machine language or object code ¨ Assembly language Symbolic language ¨ High-level for coding machine ¨ language instructions. Example: ADD A, B, C © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 16

Software (4/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming

Software (4/4) n Program ¨ n Execution ¨ n Performing the instruction sequence Programming language ¨ n Sequence of instruction that tells a computer what to do Language for writing instructions to a computer Major flavors Machine language or object code ¨ Assembly language Detailed knowledge of the machine is not required. Uses a vocabulary ¨ High-level ¨ and structure closer to the problem being solved. Examples: Java, C, C++, Prolog, Scheme. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 17

Translation n n High-level language programs (source programs) must be translated into machine code

Translation n n High-level language programs (source programs) must be translated into machine code for execution Translator ¨ n Compiler ¨ n Accepts a program written in a source language and translates it to a program in a target language Standard name for a translator whose source language is a high-level language Interpreter ¨ A translator that both translates and executes a source program © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 18

Java n A high-level object-oriented language developed by Sun. n Two types of Java

Java n A high-level object-oriented language developed by Sun. n Two types of Java programs Applet: runs within a web browser. ¨ Application: a complete stand-alone program. ¨ n We will focus on this. Java’s clean design and wide availability make it an suitable language for teaching the fundamentals of computer programming. Acknowledgement: Cohoon and Davidson © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 19

Java translation n n Two-step process First step ¨ n Translation from Java to

Java translation n n Two-step process First step ¨ n Translation from Java to bytecodes n Bytecodes are architecturally neutral object code n Bytecodes are stored in a file with extension. class Second step ¨ An interpreter translates the bytecodes into machine instructions and executes them n Interpreter is known as a Java Virtual Machine (JVM), a program that mimics the operation of a real machine n JVM reads the bytecodes produced by Java compiler and executes the bytecodes Acknowledgement: Cohoon and Davidson © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 20

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Determine the inputs, outputs,

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Determine the inputs, outputs, and other components of the problem. Description should be sufficiently specific to allow you to solve the problem. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 21

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Describe the components and

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Describe the components and associated processes for solving the problem. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 22

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Develop solutions for the

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Develop solutions for the components and use those components to produce an overall solution. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 23

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Test the components individually

Problem Solving Process (1/3) n n Analysis Design Implementation Testing Test the components individually and collectively. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 24

Problem Solving Process (2/3) © CS 1101 (AY 2009 -2010 Semester 1) Week 1

Problem Solving Process (2/3) © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 25

Problem Solving Process (3/3) n Refer also to Jumpstart to So. C on course

Problem Solving Process (3/3) n Refer also to Jumpstart to So. C on course website, “Misc…”, “For Freshmen”. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 26

Pólya: How to Solve It (1/2) A great discovery solves a great problem but

Pólya: How to Solve It (1/2) A great discovery solves a great problem but there is a grain of discovery in the solution of any problem. Your problem may be modest; but if it challenges your curiosity and brings into play your inventive faculties, and if you solve it by your own means, you may experience the tension and enjoy the triumph of discovery. Such experiences at a susceptible age may create a taste for mental work and leave their imprint on mind and character for a lifetime. – George Pólya © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 27

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase 2: Devising a plan n Phase 3: Carrying out the plan n Phase 4: Looking back © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 28

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase 2: Devising a plan n Phase 3: Carrying out the plan n Phase 4: Looking back ¨ What is the unknown? What are the data? ¨ What is the condition? Is it possible to satisfy the condition? Is the condition sufficient to determine the unknown? ¨ Draw a figure. Introduce suitable notation. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 29

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase 2: Devising a plan n Phase 3: Carrying out the plan n Phase 4: Looking back ¨ Have you seen the problem before? Do you know a related problem? ¨ Look at the unknown. Think of a problem having the same or similar unknown. ¨ Split the problem into smaller sub-problems. ¨ If you can’t solve it, solve a more general version, or a special case, or part of it. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 30

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase 2: Devising a plan n Phase 3: Carrying out the plan n Phase 4: Looking back ¨ Carry out your plan of the solution. Check each step. ¨ Can you see clearly that the step is correct? ¨ Can you prove that it is correct? © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 31

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase

Pólya: How to Solve It (2/2) n Phase 1: Understanding the problem n Phase 2: Devising a plan n Phase 3: Carrying out the plan n Phase 4: Looking back ¨ Can you check the result? ¨ Can you derive the result differently? ¨ Can you use the result, or the method, for some other problem? © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 32

Algorithmic Problem Solving n An algorithm is a well-defined computational procedure consisting of a

Algorithmic Problem Solving n An algorithm is a well-defined computational procedure consisting of a set of instructions, that takes some value or set of values, as input, and produces some value or set of values, as output. Input © CS 1101 (AY 2009 -2010 Semester 1) Algorithm Output Week 1 - 33

Algorithm n Each step of an algorithm must be exact. n An algorithm must

Algorithm n Each step of an algorithm must be exact. n An algorithm must terminate. n An algorithm must be effective. n An algorithm must be general. n Can be presented in pseudo-code or flowchart. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 34

Euclidean algorithm n First documented algorithm by Greek mathematician Euclid in 300 B. C.

Euclidean algorithm n First documented algorithm by Greek mathematician Euclid in 300 B. C. ¨ To compute the GCD (greatest common divisor) of two integers. 1. Let A and B be integers with A > B ≥ 0. 2. If B = 0, then the GCD is A and algorithm ends. 3. Otherwise, find q and r such that A = q. B + r where 0 ≤ r < B 4. Replace A by B, and B by r. Go to step 2. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 35

Find maximum and average of a list of numbers (1/3) n Version 1 Declare

Find maximum and average of a list of numbers (1/3) n Version 1 Declare variables sum, count and max. First, you initialise sum, count and max to zero. Then, you enter the input numbers, one by one. For each number that you have entered, assign it to num and add it to the sum. Increase count by 1. At the same time, you compare num with max. If num is larger than max, let max be num instead. After all the numbers have been entered, you divide sum by the numbers of items entered, and let ave be this result. Print max and ave. End of algorithm. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 36

Find maximum and average of a list of numbers (2/3) n Version 2 sum

Find maximum and average of a list of numbers (2/3) n Version 2 sum count 0 // sum = sum of numbers // count = how many numbers are entered? max 0 // max to hold the largest value eventually for each num entered, count + 1 sum + num if num > max then max num ave sum / count print max, ave © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 37

Find maximum and average of a list of numbers (3/3) n Terminator box start

Find maximum and average of a list of numbers (3/3) n Terminator box start Flowchart Process box sum count 0 max 0 Yes Decision box end of input? No ave sum/count increment count sum + num No print max, ave num > max? Yes max num No end © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 38

Handling a list (1/2) n In the previous example, we compute the maximum as

Handling a list (1/2) n In the previous example, we compute the maximum as we read in the input numbers one by one. n In many applications, it might be desirable to read in the whole list of numbers first, then we work on the list. n To do this, we need to introduce some notation. n Given a list A with n items, we may refer to the individual items as A 0, A 1, A 2, …, An-1 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 39

Handling a list (2/2) n We can then write version 3: count 0 //

Handling a list (2/2) n We can then write version 3: count 0 // count = how many numbers are entered? while not end of input enter value for Acount + 1 sum 0 max 0 // sum = sum of numbers // max to hold the largest value eventually for i from 0 to count – 1 sum + Ai if Ai > max then max Ai ave sum / count print max, ave © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 40

Control structures n Sequence n Branching (selection) n Loop (repetition) © CS 1101 (AY

Control structures n Sequence n Branching (selection) n Loop (repetition) © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 41

Examples (1/4) n Example 1: Compute the average of three integers. Variables used: A

Examples (1/4) n Example 1: Compute the average of three integers. Variables used: A possible algorithm: enter values for num 1, num 2, num 3 ave ( num 1 + num 2 + num 3 ) / 3 print ave num 1 © CS 1101 (AY 2009 -2010 Semester 1) num 3 ave Variables used: Another possible algorithm: enter values for num 1, num 2, num 3 total ( num 1 + num 2 + num 3 ) ave total / 3 print ave num 2 num 1 num 2 num 3 total ave Week 1 - 42

Examples (2/4) n Example 2: Arrange two integers in increasing order (sort). Algorithm A:

Examples (2/4) n Example 2: Arrange two integers in increasing order (sort). Algorithm A: enter values for num 1, num 2 // Assign smaller number into final 1, // larger number into final 2 if num 1 < num 2 then final 1 num 1 final 2 num 2 else final 1 num 2 final 2 num 1 Variables used: num 1 num 2 final 1 final 2 // Transfer values in final 1, final 2 back to num 1, num 2 num 1 final 1 num 2 final 2 // Display sorted integers */ print num 1, num 2 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 43

Examples (3/4) n Example 2: Arrange two integers in increasing order (sort). Algorithm B:

Examples (3/4) n Example 2: Arrange two integers in increasing order (sort). Algorithm B: enter values for num 1, num 2 // Swap the values in the variables if necessary if num 2 < num 1 then temp num 1 num 2 temp Variables used: num 1 num 2 temp // Display sorted integers */ print num 1, num 2 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 44

Examples (4/4) n Example 3: Find the sum of positive integers up to n

Examples (4/4) n Example 3: Find the sum of positive integers up to n (assuming that n is a positive integer). Algorithm: enter value for n // Initialise a counter count to 1, and ans to 0 count 1 ans 0 while count <= n do the following ans + count // add count to ans count + 1 // increase count by 1 Variables used: n count ans // Display answer print ans © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 45

Step-wise Refinement (1/2) n From preceding examples, we can see that in general an

Step-wise Refinement (1/2) n From preceding examples, we can see that in general an algorithm comprises three steps: q Input (read data (at the moment from user)) q Compute (process the input data to generate some answers) q Output (display the answers) n The ‘compute’ step is in general the most complex. n Step-wise refinement – breaking down a complex step into smaller steps. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 46

Step-wise Refinement (2/2) n Example: Given a list A containing n integers, how would

Step-wise Refinement (2/2) n Example: Given a list A containing n integers, how would you find the second largest value in the list? n Before we begin, remember Phase 1 of “How To Solve It”: Understanding the problem. q n Is the problem clear? If not, ask questions! One possible algorithm: read values into A sort A in descending order print A 1 © CS 1101 (AY 2009 -2010 Semester 1) // step 1: input // step 2: compute // step 3: output Week 1 - 47

Step-wise Refinement (3/3) n We can actually stop here, if we are clear about

Step-wise Refinement (3/3) n We can actually stop here, if we are clear about how to do each step. n If not, we need to refine the step. For instance, step 2, how do we sort? q n We won’t discuss this now as sorting will be covered later. Can you solve this problem without using sorting? © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 48

Task 1: Area of a circle (1/2) n What is the data? Side of

Task 1: Area of a circle (1/2) n What is the data? Side of square = 2 a n What is the unknown? Area of circle, C. n What is the condition? If radius r is known, C can be calculated. n How to obtain r? 2 a © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 49

Task 1: Area of a circle (2/2) a n r Pythagoras’ theorem: r 2

Task 1: Area of a circle (2/2) a n r Pythagoras’ theorem: r 2 = 2 * a 2 a n Area of circle C = * r 2 = * 2 * a 2 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 50

Task 2: Pascal’s triangle 0 C 0 1 Compute n. Ck or C(n, k)

Task 2: Pascal’s triangle 0 C 0 1 Compute n. Ck or C(n, k) n n-1 1 1 C = C + Ck C 0 k k-1 1 2 1 1, if k=0 or k=n 1 C 1 1 3 3 1 3 C 1 1 4 6 4 1 1 5 10 10 5 1 1 5 C 3 © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 51

Task 3: NE-paths n To find the number of north-east paths between any two

Task 3: NE-paths n To find the number of north-east paths between any two points. n North-east (NE) path: you may only move northward or eastward. n How many NE-paths between A and C? C A A © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 52

Task 4: Palindrome n A word is a palindrome if it reads the same

Task 4: Palindrome n A word is a palindrome if it reads the same forward and backward. ¨ n Examples: NOON, RADAR. How do you determine if a word W is a palindrome? © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 53

Task 5: Anagrams n Two phrases are anagrams if one is formed by rearranging

Task 5: Anagrams n Two phrases are anagrams if one is formed by rearranging the letters of the other, disregarding spaces and punctuation marks. ¨ n For our purpose, we’ll do a simpler version on words without spaces or punctuation marks, and all letters are in capital. q n Examples: “Debit card” = “Bad credit”; “The eyes” = “They see”; “Astronomer” = “Moon starer”; “A telescope” = “To see place”; “A decimal point” = “I’m a dot in place”. Example: “LISTEN” = “SILENT”. How do you determine if two words X and Y are anagrams? © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 54

Task 6: Coin change n n Given this list of coin denominations: 1¢, 5¢,

Task 6: Coin change n n Given this list of coin denominations: 1¢, 5¢, 10¢, 20¢, 50¢, and $1, find the smallest number of coins needed for a given amount. You do not need to list out what coins are used. ¨ Example 1: For $3. 75, 6 coins are needed. ¨ Example 2: For $5. 43, 10 coins are needed. For simplicity, assume that the input data is in cents. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 55

Algorithm before coding n Preceding examples show that we can discuss problems and their

Algorithm before coding n Preceding examples show that we can discuss problems and their solutions (algorithms) without writing out the codes. n A sample program development process: q Understanding the problem (if in doubt, ask questions!): 5 minutes q Writing the algorithm: 30 minutes q Testing the algorithm: 20 minutes q Writing the program: 20 minutes q Testing and debugging the program: 30 minutes to 3 hours or more n For more complex problems, time spent in thinking about the algorithm could far exceed time spent in writing the program. n The more time you invest in writing a good algorithm, the more time you will save in debugging your program. © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 56

Summary for Today n Today’s most important lessons q Module objectives and resources q

Summary for Today n Today’s most important lessons q Module objectives and resources q q q Module website, IVLE, This CS 1101 Handy Handbook, etc. Problem-solving q As a systematic, logical process q Steps in problem-solving Algorithms q How to write pseudo-codes q Control structures: sequence, selection, repetition © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 57

Announcements/Things-to-do n Discussion classes start in week 3. n Check out IVLE regularly for

Announcements/Things-to-do n Discussion classes start in week 3. n Check out IVLE regularly for announcements and updates. n To prepare for next week: q Visit module website and IVLE q Read “This CS 1101 Handy Handbook” q Read Chapters 1 and 2 and their Power. Point files before you come for lecture © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 58

End of File © CS 1101 (AY 2009 -2010 Semester 1) Week 1 -

End of File © CS 1101 (AY 2009 -2010 Semester 1) Week 1 - 59