1. Algorithm: an Algorithm is a set of instructions for solving a problem step by step. 2. Goal: the goal is about to count people in the room. 3. Pseudo code: the pseudo code is the language of programming. 4. Variable: variable is a letter that is equal to zero. 5 Loop: a loop is a sequence of steps that will repeat some number of times. 6. How to test an algorithm: it describe how we will go about counting. 7 How to make an algorithm: we start counting something starting at zero then for each one in the room we increment N by 1. so in the first trip trough the loop, we uptraid N from zero to 1 on the second trip thought that same loop. 8 Testing algorithm: if you want to count people in a room, and in the room are 3 people, the result will be 3. If the answer isn't 3, then the algorithm is wrong. 9 We test corner cases: Suppose that are zero people in the room, we initialize N equal to zero but this time line doesn't execut...
Comments
Post a Comment