Homework? If you have the algorithm it should be self explaning.
it should go something like this:
determine top and botomn
define current point and set it to top
while current point is not botomn
calculate left and right edge of polygon on the current point's height
draw horizontal line from left to right
set current point to next moveing to botomn (when current point is the same as botomn the loop will end)