Assignment 1- Introduction to Flowcharts
Assignment 1- Introduction to Flowcharts
Introduction to Flowcharts
[Must Read Before Starting Lab of CSE110. Also, Submit a Signed Copy to the Lab Faculty. ]
Beginner
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.
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
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.
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
[You are not allowed to use loops to solve this task.]
Expert
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.
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 JDK and DrJava
https://www.youtube.com/watch?v=Gss9sL3Q-8s