Grade 8 SDLC Report
Grade 8 SDLC Report
Project name:
Summary
In the box below: write a summary of your program. (Due 8th April)
Flowchart:
In the box below, include a flowchart diagram of your program. (Due 1st April)
Program code:
Your final python code should go here. (Due 25th April)
Valid = False
Shape = ["TRIANGLE", "RECTANGLE", "SQUARE", "CIRCLE"]
while Valid == False:
for i in Shape:
print(i)
Select = input("What shape's area shall we calculate today?\
n")
if Select in Shape:
Valid == True
if Select == "TRIANGLE":
base= int(input("enter base of triangle please| Base: "))
height = int(input("enter height of triangle| Height: "))
if base > 0 and height > 0:
print("The area of your triangle is", base*height/2)
if base <= 0 or height <= 0:
print("Invalid input")
elif Select == "RECTANGLE":
recheight = int(input("please enter height of rectangle\n: "))
recwidth = int(input("please enter width of rectangle\n: "))
if recheight > 0 and recwidth > 0:
print ("your answer is ", recheight*recwidth)
if recheight <= 0 or recwidth <= 0:
print("Invalid input")
elif Select == "SQUARE":
side= int(input("please enter the side of the square\n: "))
if side > 0:
print("your answer is ", side*side)
if side <= 0:
print("Invalid input")
elif Select == "CIRCLE":
radius = int(input("please enter the radius of the circle\n:
"))
if radius > 0:
print("your answer is ", 3.14*radius*radius)
if radius <= 0:
print("Invalid input")
else:
print("invalid choice\n")
Testing
ALL user’s input must be tested with an accepted value and a rejected value. (Due 8th April)
Types of testing can include either range check or type check. See example below: