CSC111 Homework 2 2011

From dftwiki3
Revision as of 12:29, 20 September 2011 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- <center> <font size="+2">Page under construction!</font> <br \>300px </center> __TOC__ =Problem #1= =Problem #2= I have written a Py...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut 13:29, 20 September 2011 (EDT)


Page under construction!
UnderConstruction.jpg

Problem #1

Problem #2

I have written a Python program and have executed it several times in Idle. I'm including below the output of the program captured from the shell window:

>>> ================================ RESTART ================================
>>> ================================ RESTART ================================
>>> 
How many lines do you want printed? 0
>>> ================================ RESTART ================================
>>> 
How many lines do you want printed? 1
 *
>>> ================================ RESTART ================================
>>> 
How many lines do you want printed? 2
 *
*... **
>>> ================================ RESTART ================================
>>> 
How many lines do you want printed? 3
 *
*... **
**...... -***
>>> ================================ RESTART ================================
>>> 
How many lines do you want printed? 10
 *
*... **
**...... -***
***......... --****
****............ ---*****
*****............... ----******
******.................. -----*******
*******..................... ------********
********........................ -------*********
*********........................... --------**********
>>> 

Your assignment is to write a program that behaves exactly, or as close to the program I have written as possible. In particular, notice that when I entered 0, it didn't print anything. When I entered 1, it printed one line. When I entered 2 it printed 2 lines. 3, 3 lines; 10, 10 lines.

You do not have to worry about the extra space at the beginning of the first line. Your program will be be good even if it prints the first star of the first line in the left most column.