#  secondGraphics.py
#
#  Description: Program that uses rectangles to create a bar graph of class grades.
#  Input      : Number of A's, B's, C's, D's, and F's in a class.
#  Output     : Bars in a bar chart representing the numbers input above.

from graphics import *

def main ():
    win = GraphWin("Class Curve", 340,340)
    
    numA = eval (input ("Enter number of A's: "))
    numB = eval (input ("Enter number of B's: "))
    numC = eval (input ("Enter number of C's: "))
    numD = eval (input ("Enter number of D's: "))
    numF = eval (input ("Enter number of F's: "))
    
    barA = Rectangle (Point (20, 300), Point (80, 300-numA*5))
    barB = Rectangle (Point (80, 300), Point (140, 300-numB*5))
    barC = Rectangle (Point (140, 300), Point (200, 300-numC*5))
    barD = Rectangle (Point (200, 300), Point (260, 300-numD*5))
    barF = Rectangle (Point (260, 300), Point (320, 300-numF*5))

    win.setBackground ("white")
    
    line = Line (Point (0, 300), Point (400,300))
    line.draw(win)
    
    barA.setFill("red")
    barA.draw(win)
    barB.setFill("red")
    barB.draw(win)
    barC.setFill("red")
    barC.draw(win)
    barD.setFill("red")
    barD.draw(win)
    barF.setFill("red")
    barF.draw(win)
   
    input ("Press <enter> to continue...")
    win.close()
main()
