Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RectArea(length, width)
- area = length * width
- print(area)
- end
- function SumOut(length, width)
- sum = length + width
- print(sum)
- end
- function RectPerimeter(length, width)
- perimeter = 2* length + width * 2
- print(perimeter)
- end
- q = 0
- while(q ~= "q" ) do
- print("what is length?")
- storeLength =tonumber(read())
- print("what is width?")
- storeWidth =tonumber(read())
- print("q to exit")
- q = read()
- print("area")
- RectArea(storeLength, storeWidth)
- print("perimeter")
- RectPerimeter(storeLength, storeWidth)
- print("sum")
- SumOut(storeLength,storeWidth)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement