Question: PY. TEMPLATE BELOW : This is your template. Implement all solutions in the appropriate function / class. You are encouraged to implement you own

 PY. TEMPLATE BELOW : """ This is your template. Implement allsolutions in the appropriate function / class. You are encouraged to implement

PY. TEMPLATE BELOW :

"""

This is your template. Implement all solutions in the appropriate

function / class. You are encouraged to implement you own helper functions

as

needed with a short (one-line) description of their purpose.

Hint: copy and paste the function descriptor format from lab1.py to save

time.

"""

class Robot:

""" implement this class below with appropriate function descriptors

"""

def __init__(self, safety_word, pos):

self.pos_x = pos[0]

self.pos_y = pos[1]

self.safety_word = safety_word

def beep():

pass

def raise_alarm(self, n):

pass

def emote(self):

pass

def move(self, vector):

pass

class Cyborg(Robot):

""" implement this class below with appropriate function descriptors

"""

def __init__(self, name, mood, safety_word. pos):

Robot.__init__(self, safety_word, pos)

self.name = name

self.mood = mood

def emote(self):

pass

def announce_move(self, pos_old, pos_new):

pass

def move(self, vector):

pass

1. Robot Class Finish implementing the Robot Class in the provided Python file. Variables and function descriptions have been provided below. Variables str: safety_word The phrase our robot uses to indicate danger float: pos_x The x coordinate of our robot's current position float: pos_y The y coordinate of our robot's current position Functions beep0) Prints "beep" to screen raise_alarm(self, n) Prints the robot's safety word n times to screen with a 1s pause between each print emote(self) Does nothing since robots generally can't emote move(self, vector) Moves the robot by the distances specified by the input vector (a tuple) e.g. if original pos is (4, 5) and move(1,-2)) is called, our robot's new pos is (5, 3)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!