Question: Goal: Learn to define classes with internal state, and getter and setter methods. Feedback: Expected attribute width t o exist Expected value t o b

Goal: Learn to define classes with internal state, and getter and setter methods. Feedback:
Expected attribute width to exist
Expected value tobe(0.91,0.92,0.9), instead got (0.0,0.0,0.0)
Expected value tobe999.99, instead got 0.0
Assignment: Write the definition of a class named Asteroid that has the following methods:
An method that initializes the following attributes:
An attribute width that should be assigned 0.0;
An attribute height that should be assigned 0.0;
An attribute depth that should be assigned 0.0 ;
An attribute speed that should be assigned 0.0.
A method set_size that accepts three arguments and assigns the first to width, the
second to height, and the third to depth;
A method set_speed that accepts one argument and assigns it to speed;
A method get_size that returns a tuple of three items, the first being width, the second
height, and the third depth;
A method get_speed that returns the value of speed.
 Goal: Learn to define classes with internal state, and getter and

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!