""" This program displays the plots of the costs of a track rental in four different companies. """ import math import random import turtle t = turtle.Turtle() wn = turtle.Screen() wn.title("Track Rentals") # set the dimensions of the window wn.setup(600, 600) # constrain the coordinate system so that it represents a 1 x 1 plane wn.setworldcoordinates(-10, -10, 200, 200) # turn animation off wn.tracer(0) t.up() #draw the coordinates t.pencolor("black") t.goto(-10, 0) t.pendown() t.forward(210) t.up() t.goto(0, -10) t.left(90) t.pendown() t.forward(210) t.up() t.goto(-5,-9) t.write("0", font=("Arial", 16, "normal")) t.up() #plot the function for watertown track rental # w(m) = 79.00 t.pencolor("green") m = 0.0 while m < 200: w = 79.00 t.goto(m,w) t.dot() if m == 160: t.goto(m,w+3) t.write("Watertown", font=("Arial", 16, "normal")) m = m + 1 #plot the function for U-Haul track rental # h(m) = 29.99 + 1.39*m t.pencolor("red") m = 0.0 while m < 200: h = 29.99 + 1.39 * m t.goto(m,h) t.dot() if m == 100: t.goto(m-25,h) t.write("U-Haul", font=("Arial", 16, "normal")) m = m + 1 #plot the function for Budget track rental # b(m) = 29.99 + 1.39*m t.pencolor("orange") m = 0.0 while m < 200: b = 29.99 + 0.99 * m t.goto(m,b) t.dot() if m == 150: t.goto(m+10,b) t.write("Budget", font=("Arial", 16, "normal")) m = m + 1 #plot the function for Enterprise track rental # e(m) = 59.99 if m < 100 # = 59.99 + 0.59*m if m > 100 t.pencolor("blue") m = 0.0 while m < 200: if m < 100 : e = 59.99 else : e = 59.99 + 0.59 * (m - 100) t.goto(m,e) t.dot() if m == 160: t.goto(m,e+25) t.write("Enterprise", font=("Arial", 16, "normal")) m = m + 1 # only close the window when it is clicked wn.exitonclick()