Highest - Lowest

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

2..

1 ALGORITHM DESIGN AND PROBLEM-SOLVING AHMED THAKUR


2.1.2 INTERNET PRINCIPLES OF OPERATION

HIGHEST LOWEST TECHNIQUE

7010/13/O/N/10
17 (a) Write an algorithm, using pseudocode or a flowchart, which
_ inputs a set of positive numbers (which end with -1)
_ outputs the average (mean) value of the input numbers
_ outputs the value of the largest (highest) number input

(b) Write an algorithm, using pseudocode or a flowchart, which


_ inputs a whole number (which is > 0)
_ calculates the number of digits in the number
_ outputs the number of digits and the original number
(E.g. 147 would give an output of 3, 147)

7010/13/O/N/11
16 The weather conditions in a town are being monitored over a year (365 days). The values
recorded per day are weather type and temperature (e.g. CLOUDY, 25).
Write an algorithm, using pseudocode or flowchart only, which:
inputs the weather type and temperature for each day
outputs the number of days that were CLOUDY, RAINING, SUNNY or FOGGY
outputs the highest recorded temperature for the year
outputs the lowest recorded temperature for the year

7010/01/O/N/05
17 A school uses a computer to store student marks obtained in an end of term mathematics
exam. There are 150 students doing the exam and the maximum mark is 100.
Write an algorithm, using pseudocode or otherwise, which
inputs the marks for all students
checks if each mark is in the correct range and, if not, the mark is re-input
outputs the smallest mark
outputs the highest mark
outputs the average mark for the exam.

COMPUTER SCIENCE https://www.facebook.com/groups/OAComputers/


Page 1
2210
2..1 ALGORITHM DESIGN AND PROBLEM-SOLVING AHMED THAKUR
2.1.2 INTERNET PRINCIPLES OF OPERATION

7010/01/O/N/07.

7010/01/O/N/09

(b) Write an algorithm, using pseudocode or otherwise, which inputs the times for 500
cars, calculates the final speed of each car using the formula in part (a), and then
outputs:
the final speed for ALL 500 cars
the slowest (lowest) final speed
the fastest (highest) final speed
the average final speed for all the cars.

COMPUTER SCIENCE https://www.facebook.com/groups/OAComputers/


Page 2
2210

You might also like