# a6q5 - Testings window(0 print"Test 1"...

This preview shows pages 1–2. Sign up to view the full content.

## CS 116 Assignment 6 Question 5 ## Ru Wang r46wang 20319247 ## window: integer[non-negative] -> void ## purpose: this functio consumes an non negative integer and produces nothing ## Effects: it draws a window with 4 panes with the size determined by the integer entered. ## Examples: ## window(0) => ## *** ## *** ## *** ## window(1) => ## *-*-* ## | | | ## *-*-* ## | | | ## *-*-* def window(n): print "*" + "-"*n + "*" + "-"*n + "*" x = n while x>0: print "|" + " "*n + "|" + " "*n + "|" x = x - 1 print "*" + "-"*n + "*" + "-"*n + "*" y = n while y>0: print "|" + " "*n + "|" + " "*n + "|" y = y - 1 print "*" + "-"*n + "*" + "-"*n + "*"

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ## Testings: ## window(0): print "Test 1" print "Expect to see: " print "***" print "***" print "***" print "Actual output follows: " window(0) ## window(1): print "Test 2" print "Expect to see: " print "*-*-*" print "| | |" print "*-*-*" print "| | |" print "*-*-*" print "Actual output follows" window(1) ## window(3): print "Test 3" print "Expect to see: " print "*---*---*" print "| | |" print "| | |" print "| | |" print "*---*---*" print "| | |" print "| | |" print "| | |" print "*---*---*" print "Actual output follows" window(3)...
View Full Document

## This note was uploaded on 10/21/2010 for the course CS 116 taught by Professor T.vasiga during the Fall '09 term at Waterloo.

### Page1 / 2

a6q5 - Testings window(0 print"Test 1"...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online