0% found this document useful (0 votes)
11 views1 page

Fundamentals of Algorithms - Tutorial Sheet 1

The document is a tutorial sheet containing a series of algorithm exercises related to basic mathematical conversions and calculations. It includes tasks such as converting lengths, calculating averages, determining grades based on percentages, and finding factorials. Each exercise also requires the creation of a corresponding flowchart.

Uploaded by

anyejude96
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)
11 views1 page

Fundamentals of Algorithms - Tutorial Sheet 1

The document is a tutorial sheet containing a series of algorithm exercises related to basic mathematical conversions and calculations. It includes tasks such as converting lengths, calculating averages, determining grades based on percentages, and finding factorials. Each exercise also requires the creation of a corresponding flowchart.

Uploaded by

anyejude96
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

TUTORIAL SHEET N°1 (ALGORITHMS AND FLOWCHARTS)

1. Write an algorithm to enter length in centimeter and convert it into meter and
kilometer.

2. Write an algorithm to convert days into years, months and days. (Let’s assume
that each year contains 365 days, and each day 30 days)

3. Write an algorithm to convert seconds into hours, minutes and seconds.

4. Write an algorithm to enter marks of five subjects and calculate total, average
and percentage.

5. Write an algorithm to find power of any number x^y.

6. Write an algorithm to check whether a number is positive, negative or zero.

7. Write an algorithm to input marks of five subjects Physics, Chemistry, Biology,


Mathematics and Computer. Calculate percentage and grade according to
following:

Percentage >= 90%: Grade A


Percentage >= 80%: Grade B
Percentage >= 70%: Grade C
Percentage >= 60%: Grade D
Percentage >= 40%: Grade E
Percentage < 40%: Grade F

8. Write an algorithm to calculate and display the sum of all even numbers
between 1 and 99.

9. Write an algorithm to calculate and display the sum of all odd numbers between
0 and n.

10. Write an algorithm to swap values of two variables.

11. Write an algorithm to calculate and display the value of .

12. Write an algorithm to calculate factorial of n.

Note: for each exercise, draw the corresponding flowchart.


Page 1 on 1

You might also like