# nameboxCh5.py
#
# Description: Program to draw rectangle with input name in the center.
# Input      : First name and last name.
# Output     : Name in order: Last, <First initial>. centered within a 
#              graphics rectangle.

from graphics import *

def main ():
    first = input ("Enter first name: ")
    last = input ("Enter last name: ")
    
    # make the rectangle
    win = GraphWin ("Fun With Names", 600, 500)
    myRectangle = Rectangle (Point (100, 100), Point (500, 300))
    myRectangle.draw(win)

    # make the string and draw it in the rectangle
    outText = last + ", " + first [0] + "."
    Text (Point (300, 200), outText).draw(win)
    
    # close window when user presses <return>
    input ("Press <return> to continue...")
    win.close()
main()
