Difference between revisions of "CSC111 A Form Generator Program"
(→Exercise) |
(→Solution Program) |
||
Line 140: | Line 140: | ||
print( blank ) | print( blank ) | ||
print( bar ) | print( bar ) | ||
+ | # print blank box | ||
for i in range( heightBox ): | for i in range( heightBox ): | ||
print( blank ) | print( blank ) |
Revision as of 07:57, 27 September 2011
--D. Thiebaut 08:54, 27 September 2011 (EDT)
Exercise
Write a Python program that displays forms around names. The forms can be used to record information about candidates for a particular position, for example.
Below is an example of an interaction between the user and the finished program:
>>> ================================ RESTART ================================ >>> +--------------------------------------+ |formgen.py | Date: | | +-------------------+ | | +--------------------------------------+ | | | AUTOMATIC FORM GENERATOR | | | | | | | +--------------------------------------+ Width of box? 40 Height of blank box? 4 How many names? 3 > Alice > Tintin et Milou > Bugs Bunny +--------------------------------------+ |Alice | Date: | | +-------------------+ | | +--------------------------------------+ | | | | | | | | +--------------------------------------+ +--------------------------------------+ |Tintin et Milou | Date: | | +-------------------+ | | +--------------------------------------+ | | | | | | | | +--------------------------------------+ +--------------------------------------+ |Bugs Bunny | Date: | | +-------------------+ | | +--------------------------------------+ | | | | | | | | +--------------------------------------+
>>>
Solution Program