CP Lab 1
CP Lab 1
1. For each of the following statement write down the flow chart symbol you will use.
A B C D E F
2. Write down the problem statement for the following flow chart.
19CS78
2
3. For each of the following problem statement, create the IPO chart with
algorithm and Flow chart.
Problem Statement 1
Write a computer program that accepts the base and height of a right angle triangle
from the user and displays the area of the triangle.
19CS78
3
Problem Statement 2
A person is running in a circular ground. Write a computer program that asks the
user to input the radius of the ground in meters and the number of rounds the
person completes. The program should display the amount of distance travelled by
the person in meters.
19CS78
4
Problem Statement 3
Write a program that asks the user to enter two integer numbers, stores them in
variables num1 and num2 respectively. The program swaps the values of two
variables with each other without using a third variable and displays the values of
both the variables after swapping.
19CS78
5
Algorithm
Step 01: start
Step 02: input num and
num2 from user
Step 03: calculate
num=num+num2;
Step 04: calculate
num2=num-num2;
Step 05: calculate
num=num-num2;
Step 06: print num and
num2
Step 07: End
Problem Statement 4
Write a program that asks the user to enter a four digit integer number and displays
the average of all the four digits of a number.
19CS78
6
19CS78
7
Problem Statement 5
A person enters the bank and stands in the queue to get his salary. When his turn
comes, he requests the cashier that I need my salary with minimum notes and coins.
Write a program for the cashier that first asks the cashier to enter the salary amount
and then displays the number of notes and coins of (Rs. 5000, Rs. 1000, Rs. 100, Rs.
50, Rs. 20, Rs. 10, Rs. 5, Rs. 2 and Re. 1).
19CS78
8
19CS78
9
19CS78