Professional Documents
Culture Documents
1. What is the difference between FOR ... TO ... NEXT, REPEAT ... UNTILand
WHILE ... DO ... ENDWHILE ?
2. A company has 5000 CDs, DVDs, videos and books in stock. Each item has a
unique 5-digit code with the first digit identifying the type of item, i.e.
For example, for the code 15642 the 1 identifies that it is a CD, and for the code 30055
the 3 identifies that it is a video.
Inputs the codes for all 5000 itemsValidates the input codeCalculates how many CDs,
DVDs, videos and books are in stock Outputs the four totals.
3.The height of buildings and number of floors in buildings was being analyzed.
Write an algorithm , using pseudocode only, which
Inputs an height and number of floors for 200 buildings
Outputs the average height of all the buildings
Outputs the number of building with more than 50 floors
Outputs the height of the tallest building
4. Write an algorithm using pseudocode which takes temparature input over a 100 day
period (once per day) and output the number of days when the teparature was below 20C
and number of days and when the temparature was 20C or above.