0% found this document useful (0 votes)
16 views2 pages

Loop

The document outlines a series of algorithms in pseudocode for various tasks including calculating sums, averages, and densities based on user inputs. It covers operations for multiple datasets such as temperatures, heights, weights, and speeds of cars. Each task specifies the number of inputs and the required outputs, emphasizing data handling and basic statistical calculations.

Uploaded by

thedevilednoob32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Loop

The document outlines a series of algorithms in pseudocode for various tasks including calculating sums, averages, and densities based on user inputs. It covers operations for multiple datasets such as temperatures, heights, weights, and speeds of cars. Each task specifies the number of inputs and the required outputs, emphasizing data handling and basic statistical calculations.

Uploaded by

thedevilednoob32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Write an algorithm using pseudocode.

1. Input ten numbers and find their sum. output the sum.
2. Input temperature of 500 days. output the average temperature.
3. Input 15 numbers. Calculate their sum and average. Output average.
4. Inputs the population and land area for 500 countries,
Calculates the population density (i.e. population/land area) for every
country, outputs the average population density for all 500 countries.
5. Input 100 numbers and display how many are even numbers and how
many are odd numbers.
6. Input height of 50 students. Output how many of them have height
more than 6 inches.

m
7. Input weight of 100 students. Output how many students have weight
more than 70kg.

ju
8. A school is doing a check on the heights and weights of all its students.
An
The school has 1000 students. Write an algorithm, using pseudocode or
a flowchart, which
 inputs the height and weight of all 1000 students
ia

 outputs the average (mean) height and weight


az

 includes any necessary error traps for the input of height and
weight
Sh

9. 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 (Final Speed = 200/Time (hours))
 the slowest (lowest) final speed
 the fastest (highest) final speed
 the average final speed for all the cars.
10. Using pseudocode, or otherwise, write an algorithm that will input the
hourly temperatures for one day in Centigrade and print out in
Fahrenheit
 the maximum temperature
 the minimum temperature
 the average temperature for that day.
F_temp = (1.8 ✱ C_temp) +32
11. The heights of 500 students in a school are being measured. Write an
algorithm, using pseudocode, which inputs all 500 heights and outputs
how many students were taller than 1.45 metres or shorter than 1.45
metres.

12. Write an algorithm, using pseudocode, which:


 inputs the weight of 1000 items
 outputs the weight of the heaviest and the lightest items
 outputs the average weight of all the items input.

13. The height of building and number of floors in building was being
analysed. Write an algorithm, using pseudocode, which

m
 inputs the height and number of floors for 20 building.
 output the average height of all the building.

ju
 outputs the number of buildings with more than 50 floors
 outputs the height of the tallest building.
An
14. Write an algorithm, using pseudocode or a program flowchart only,
that:
ia

 inputs a series of positive 500 numbers


az

 outputs how many numbers were less than 1000 and


 outputs how many numbers were greater than 1000.
Sh

You might also like