Lab Task No#1: Problem#1 Write An Algorithm and Draw The Flowchart For Finding The Average of Two Numbers
Lab Task No#1: Problem#1 Write An Algorithm and Draw The Flowchart For Finding The Average of Two Numbers
Problem#1
Write an algorithm and draw the flowchart for finding the average of two
numbers.
Algorithm:
Steps:
1. input x
2. input y
3. sum = x + y
4. average = sum /2
5. output average
START
Input x
Input y
Sum = x + y
Average = sum/2
Output
Average
END
Average of two numbers:
CODE INPUT:
CODE OUTPUT:
Problem#2
Write an algorithm for finding the area of a rectangle.
Algorithm:
Steps:
1. input length
2. input width
3. area=length*width
4. Output area
Start
Input length
Input width
Area=length*width
Output Area
End
Problem#3
Program that tells the person the year he/she will turn 100 years old.
CODE INPUT:
CODE OUTPUT:
Problem#4
Printing the string in a specific format
CODE INPUT:
CODE OUTPUT:
Problem#5
Write a Python program to display the current date and time.
CODE INPUT:
CODE OUTPUT:
Problem#6
Write a Python program which accepts the radius of a circle from the
user and compute the area.
CODE INPUT:
CODE OUTPUT:
Problem#7
Write a Python program which accepts the user's first and last name and print
them in reverse order with a space between them.
CODE INPUT:
CODE OUTPUT:
Problem#8
Write a Python program to print the calendar of a given month and year.
Note: Use 'calendar' module
CODE INPUT:
CODE OUTPUT:
Programming exercise#1
1.Write a program for converting Centigrade into Fahrenheit.
CODE INPUT:
CODE OUTPUT:
FLOWCHART:
Start
Input temperature in
Degree Centigrade
Fahrenheit=(Celsius*9/5) +32
Output Fahrenheit
End
Programming exercise#2
Write a program for converting Fahrenheit into Centigrade.
CODE INPUT:
CODE OUTPUT:
FLOWCHART:
Start
Input temperature in
Fahrenheit
Celsius=(Fahrenheit-32) *(5/9)
Output Celsius
End
Programming exercise#3
Write a program to calculate the area of a rectangle.
CODE INPUT:
CODE OUTPUT:
FLOWCHART:
Start
Input length
Input width
Area=length*width
Output Area
End
Programming exercise#4
4.Write a program to calculate the volume of a sphere.
CODE INPUT:
CODE OUTPUT:
FLOWCHART:
Start
Input radius
Volume = (4/3)*pi*radius**3
Output Volume
End
Programming exercise#5
Write a program that can write your name in lower case, upper case
and title case.
CODE INPUT:
CODE OUTPUT: