WordPress.com



|M/J 2002 |

|8. (b) |A procedure (subroutine) called BELT exists to take one box and put it on a conveyor |

| |belt. Write an algorithm, using this procedure, to put 50 boxes on the conveyor belt. |

|16 |Using pseudo code or otherwise, write an algorithm which will take information about each |

| |transaction at a supermarket till, calculate and output |

| |• the number of sales, |

| |• the number of refunds, |

| |• the total amount of money in the till. |

|M/J 2003 |

|13 |Read this algorithm. |

| |input A, B |

| |if A > B then |

| |T = A |

| |A = B |

| |B = T |

| |endif |

| |output A, B |

| | |

| |(a) Write down the output if the following two numbers are input: |

| |41, 38 |

| |.....................................................................................................................................[1] |

| |(b) Explain the purpose of the variable T. |

| |......................................................................................................................................... |

| |.....................................................................................................................................[1] |

| |(c) Explain why an algorithm is written as a subroutine (procedure) and stored in a program |

| |library. |

| |......................................................................................................................................... |

| |......................................................................................................................................... |

| |......................................................................................................................................... |

| |.....................................................................................................................................[2] |

|17 |A school wants to monitor the number of hours spent by a class of 30 students on the |

| |Internet. |

| |Using pseudocode or otherwise, write an algorithm which will; |

| |• for each student, record the times logged on and logged off |

| |• calculate the length of time each student spends online |

| |• calculate and output the average length of time per day spent by each student on the |

| |Internet. |

|M/J 2004 |

|15 |[pic] |

| |[pic] |

|M/J 2005 |

|13 (a) |The following algorithm contains an error. |

| |1. SET X = 1 |

| |2. REPEAT |

| |3. X = X + 2 |

| |4. Print X |

| |5. UNTIL X = 10 |

| |(a) Trace the algorithm and explain what the error is. |

| | |

| |(b) Write an algorithm which uses a While..Do..Endwhile loop and outputs the numbers 2, 4, 6 and 8. |

|17 |Using pseudocode or otherwise, write an algorithm that will input 25 marks and output the |

| |number of DISTINCTION, MERIT, PASS or FAIL grades. |

| |A mark greater than 69 will get a DISTINCTION, a mark between 69 and 60 (inclusive) will |

| |get a MERIT and a mark between 59 and 50 (inclusive) will get a PASS. |

|M/J 2006 |

|9 |[pic] |

| | |

| |Trace the flow chart using the numbers 2 and 3. Write down each of the values of N in the order that they are printed out. |

| | |

| |[pic] |

|16 (b) |[pic] |

| | |

| |Using pseudocode or otherwise, write an algorithm that will input the ID, weight (kg) and |

| |height (m) of 30 students, calculate their body mass index (BMI) and output their ID, |

| |BMI and a comment as follows: |

| | |

| |A BMI greater than 25 will get the comment ‘OVER WEIGHT’, a BMI between 25 and |

| |19 (inclusive) will get ‘NORMAL’ and a BMI less than 19 will get ‘UNDER WEIGHT’. |

|M/J 2007 |

|11 |[pic] |

| | |

| |[pic] |

|19 |[pic] |

|M/J 2008 |

|9 |[pic] |

|12 |[pic] |

|19 |[pic] |

|M/J 2009 |

|14 |[pic] |

|16 |[pic] |

|18 |[pic] |

|O/N 2001 |

|10 |[pic] |

|11 |[pic] |

|14 |[pic] |

|15 |[pic] |

|16 |[pic] |

|O/N 2002 |

|13 |[pic] |

|18 |[pic] |

| | |

| |[pic] |

|19 |[pic] |

|O/N 2003 |

|11 |[pic] |

|15 |[pic] |

|16 |[pic] |

|O/N 2004 |

|12 |[pic] |

| |[pic][6] |

|O/N 2005 |

|9 |[pic] |

|17 |[pic] |

|O/N 2006 |

|9 |[pic] |

|17 |[pic] |

|20 |[pic] |

|O/N 2007 |

| |[pic] |

| | |

| |[pic] |

|16 |[pic] |

|17 |[pic] |

| | |

| |[pic] |

|O/N 2008 |

|3 |[pic] |

|17 |[pic] |

|19 |[pic] |

|O/N 2009 |

|9 |[pic] |

|17 |[pic] |

|17 |[pic] |

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download