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

Grade 8 SDLC Report

Uploaded by

gun120510
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Grade 8 SDLC Report

Uploaded by

gun120510
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name:

Project name:

Summary
In the box below: write a summary of your program. (Due 8th April)

1.ask what shape area to calculate


2.if triangle then ask for user for base and height and output the area
3.if rectangle ask for length and width and output the area
4.if square then ask for side and output the area
5.If circle then ask for radius and multiply by 3.14

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:

Testing type Value Input code Outcome


Type check John Doe Num = int(input("Enter height: ")) Rejected
Range check -99 Num = int(input("Enter length: ")) Rejected

Testing type Value Input code Outcome


Range check -3 base = int(input(“enter base of rejected
triangle please| Base: “))
Range check 5 base = int(input("enter base of accepted
triangle please| Base: "))

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