logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Colin JenkinsEngineering
(5/5)

878 Answers

Hire Me
expert
Venktesh PrasaadMarketing
(5/5)

829 Answers

Hire Me
expert
Vitor SCriminology
(5/5)

999 Answers

Hire Me
expert
Juber HasmiManagement
(4/5)

820 Answers

Hire Me
Others

Create a custom class called animal which only contains the method _init_ used to initialize three data attributes:

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Problem 04 (40 points) 1

(10 points) Create a custom class called animal which only contains the method _init_ used to initialize three data attributes:

1) the animal's name,

2) its position along x coordinate, 3) its position along y coordinate

2 (10 points) Create a custom class dog inherited from the class animal, and define a method called distance which calculates the distance between the position of the dog and another object in a (x,y) coordinate system

3 (5 points) Create an instance of the class dog, give your dog a name, position your dog at location (0,0) in the (x,y) coordinate system. Create an instance of the class animal, give this animal the name danger, and position this animal at location (0.2,0.2). Invoke the method distance to calculate the distance between your dog and danger, then print this distance.

4 (10 points) Create an empty list named trajectory. Using a while loop, increment the x coordinate location of your dog by 0.1 at each step, recalculate the distance between your dog and danger, append this distance to the list trajectory, and exit the loop when this distance is larger than 0.8 units. Write the list in a file called Dog2D.txt 5 (5 points) Everything is an object in Python. A list is an object. In 4.4, you instantiated a list called trajectory. Invoke a built-in Python function on this list object to calculate the smallest distance your dog was to the danger in the trajectory followed, then print this distance.

 

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme