def gety(self)return self ypos finallywe come to the update method this method takes single normal parameter that represents an interval of time we need to update the state of the projectile to account for the passage of that much time here' the codedef update(selftime)self xpos self xpos time self xvel yvel self yvel time self ypos self ypos time (self yvel yvel )/ self yvel yvel basicallythis is the same code that we used in the original program updated to use and modify instance variables notice the use of yvel as temporary (ordinaryvariable this new value is saved by storing it into the object in the last line of the method that completes our projectile class we now have complete object-based solution to the cannonball problem cball py from math import pisincosradians class projectiledef __init__(selfanglevelocityheight)self xpos self ypos height theta radians(angleself xvel velocity cos(thetaself yvel velocity sin(thetadef update(selftime)self xpos self xpos time self xvel yvel self yvel time self ypos self ypos time (self yvel yvel self yvel yvel def gety(self)return self ypos def getx(self)return self xpos def getinputs()