dd1.jpg

Back 

Understanding and producing algorithms questions and answers

Q1. Describe three different ways you could produce an algorithm.
A1. You can produce an algorithm by writing a list of sentences. You can produce an algorithm by drawing a diagram, for example, a flow chart. You can produce an algorithm by writing instructions using pseudo-code.
Q2. What is meant by the phrase ‘language independent’ when talking about pseudo-code?
A2. This means that you can give the pseudo-code to programmer skilled in any language, and the pseudo-code can be converted into that language easily.
Q3. Write some pseudo-code for the following: You have to input two numbers and add them together. If the total is less than 20, you should display “Lose” but if it is 20 or more, you should display “Win”.
A3.
     Input number 1
     Input number 2
     Total = number1 + number 2
     IF Total < 20 Then
          Display “Lose”
     ELSE
          Display “Win”
     END IF

Q4. Draw a flowchart that does what is described in question 3 above.
A4.

a4

Q5. Draw a flowchart for the following: you have to enter a password. If the password is incorrect, you have to enter it again. You keep doing this until the correct password is entered.
A5.

a5

Q5. What kind of control structure is used in the password flowchart?
A5. DO WHILE (the code always gets executed at least once so in this case, the password is always entered at least once).
Q6. There is a problem with the way the password entry works in question 4 above. What is it and how might you overcome this problem?
A6. Once you are in the loop, you might never get out of it if you cannot remember the correct password. You could put a counter in, so that a user is allowed three attempts to enter the password. After the third attempt, the loop is left and a message displayed, asking them to contact the Administrator or using the ‘Recover password’ facility. 
Q7. What is the symbol for a decision in a flowchart?
A7. A diamond.
Q8. What is the symbol for processing some data or a calculation in a flowchart?
A8. A rectangle.
Q9. You can easily make flowcharts if you have Logicator at school. However, there are lots of open source applications. Try Meesoft's 'Diagram Designer' to draw one of the above flowcharts.
A9. This is a practical task. Students should be encouraged to search for and try out and evaluate open source software wherever possible.
Q10. Many software applications are moving online, so you don't have to install and maintain the software. Search for and use an online flowchart designing application. How easy is it to use once you have created a free account compared to an open source application or Logicator?

A10. This is an interesting recent development, driven in part by Google's Chromebook. As long as you have a good Internet connection, have set up some cloud storage like google Drive and are prepared to give it a go, these applications have their place.

Back