Python Lab Report 1
Algorithm and Flowchart
1. Simple Calculator
Algorithm:
Step 1: Start
Step 2: Input two numbers (a, b)
Step 3: Input an operator (+, -, *, /)
Step 4: Perform the operation according to the operator
Step 5: Display the result
Step 6: Stop
Flowchart: (Use Start → Input → Process → Decision → Output → End)
-------------------------------------------------------
2. Rectangle Area
Algorithm:
Step 1: Start
Step 2: Input length and width
Step 3: area = length * width
Step 4: Display area
Step 5: Stop
Flowchart: (Start → Input length,width → Process area = l*w → Output → End)
-------------------------------------------------------
3. Triangle Area
Algorithm:
Step 1: Start
Step 2: Input base and height
Step 3: area = 1/2 * base * height
Step 4: Display area
Step 5: Stop
Flowchart: (Start → Input base,height → Process area = 1/2*b*h → Output → End)