Assignment 1 - Introduction To Flowcharts
Assignment 1 - Introduction To Flowcharts
Introduction to Flowcharts
The students must complete the classwork tasks in the lab class to obtain the lab performance
marks. The lab instructors may show/explain a few of the classwork tasks to the students if
necessary. Any plagiarism in classwork or homework will lead to the student getting zero in the
entire assignment.
Beginner
Classwork
1. Design a flowchart to take one integer as input, store it in a variable and print its cube.
2. Create a flowchart to convert a temperature in Celsius to Fahrenheit. The user should input
the temperature in Celsius, and the flowchart should display the corresponding temperature
in Fahrenheit. The formula to convert Celsius to Fahrenheit is:
F = C × (9/5) + 32.
Homework
3. Create a flowchart to convert a temperature in Fahrenheit to Celsius. The user should input
the temperature in Fahrenheit, and the flowchart should display the corresponding
temperature in Celsius. The formula to convert Celsius to Fahrenheit is:
C = (F - 32) × 5/9
4. Design a flowchart to take three integers a, b and h as input, where a and b are the length of
the parallel sides of a trapezium, h is the distance between the parallel sides, and print the
area of the trapezium.
5. Design a flowchart to take two integers b and h as input, where, b is the base of a triangle, h
is the height of the triangle, and print the area of the triangle.
6. Design a flowchart to calculate and display the area of a rectangle. The flowchart should take
the length and width of the rectangle as input from the user and output the calculated area.
7. Create a flowchart to find the average of three numbers. The flowchart should take three
integer inputs from the user and display their average.
8. Design a flowchart to take two integer inputs from the user and display the result of their
sum, subtraction and multiplication.
Intermediate
Classwork
9. Design a flowchart to take an integer consisting of 4 digits as input and print the last 2 digits
of that number.
10. Design a flowchart to take three integers a, n, d as input where a is the first term of an
arithmetic sequence, n is the number of terms and d is the common difference between the
terms in the sequence, and print the n-th term of the arithmetic sequence.
Homework
11. Design a flowchart to take an integer consisting of 4 digits as input and print the first 2 digits
of that number.
12. Design a flowchart to take three integers a, n, d as input where a is the first term of an
arithmetic sequence, n is the number of terms and d is the common difference between the
terms in the sequence, and print the summation of the first n terms of the arithmetic
sequence.
13. Design a flowchart to display the multiplication table for a given positive integer 'n'. The
table should include the products of 'n' with each of the numbers from 1 to 10. For example,
if the user inputs 'n' as 5, the flowchart should output:
5x1=5
5 x 2 = 10
5 x 3 = 15
...
5 x 10 = 50
Expert
Classwork
14. Design a flowchart to take two numbers a and c as input (look at the image below), and print
the area of the portion colored in green. In the following image, a is the radius of the circle,
and c is the length of the sides of the square.
Homework
15. Design a flowchart to take a number a as input (look at the image below), and print the area
of the portion colored in red. In the following image, a is the diameter of the circle.
For this course we’ll be using DrJava as IDE for Java Coding:
Link to DrJava
https://www.youtube.com/watch?v=74o26PdZPts