0% found this document useful (0 votes)
14 views3 pages

1 Program

Uploaded by

harshanand0203
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)
14 views3 pages

1 Program

Uploaded by

harshanand0203
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
You are on page 1/ 3

a) Design and develop a flowchart or an algorithm for finding area of a circle, rectangle,

square & triangle.


b) Design and develop a flowchart or an algorithm to determine whether a Student Passed the
Exam or Not

Algorithm for Finding the Area of a Circle

1. Start
2. Input the Radius of the circle.
3. Set π=3.14159
4. Calculate the Area using the formula:

Area = π×(radius)2

5. Output the Area of the circle.


6. Stop

Finding Area of Circle


# Find Area of Circle
radius = float(input("Enter the radius of the circle: ")) # Ask user for radius
pi = 3.14159 # Define the constant pi
area = pi * radius * radius # Calculate area
print("The area of the circle is:", area)

Algorithm for Finding the Area of a Rectangle

1. Start
2. Input the Length of the rectangle.
3. Input the Width of the rectangle.
4. Calculate the Area using the formula:

Area=Length×Width.

5. Output the Area of the rectangle.


6. Stop

Finding Area of Rectangle


# Find Area of Rectangle
length = float(input("Enter the length of the rectangle: ")) # Ask user for length
width = float(input("Enter the width of the rectangle: ")) # Ask user for width
area = length * width # Calculate area
print("The area of the rectangle is:", area)
Algorithm for Finding the Area of a Square

1. Start
2. Input the Side length of the square.
3. Calculate the Area using the formula:

Area=Side×Side

4. Output the area of the square.


5. Stop

Finding Area of Square


# Find Area of Square
side = float(input("Enter the side length of the square: ")) # Ask user for side length
area = side * side # Calculate area
print("The area of the square is:", area)

Algorithm for Finding the Area of a Triangle

1. Start
2. Input the Base of the triangle.
3. Input the Height of the triangle.
4. Calculate the area using the formula:

Area=0.5×Base×Height

5. Output the Area of the triangle.


6. Stop

Finding Area of Triangle


# Find Area of Triangle
base = float(input("Enter the base of the triangle: ")) # Ask user for base
height = float(input("Enter the height of the triangle: ")) # Ask user for height
area = 0.5 * base * height # Calculate area
print("The area of the triangle is:", area)
Algorithm to Determine Whether a Student Passed the Exam

1. Start
2. Input the student’s exam score.
3. Set the passing score (e.g., 40).
4. Check if the student’s score is greater than or equal to the passing score.
o If yes, the student has passed.

oIf no, the student has failed.


5. Output "Passed" if the student’s score meets or exceeds the passing score,

otherwise output "Failed."

6. Stop

Determine if Student Passed Exam

# Determine if Student Passed


marks = int(input("Enter the marks obtained: ")) # Ask user for marks
passing_marks = 40 # Define the minimum passing marks
if marks >= passing_marks:
print("Passed")
else:
print("Failed")

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy