subject

Functions on Structured Data This part will be executed with: python funcs_objects tests. py
Objects
Define a class to represent a two-dimensional point. In the funcs_objects directory, create a file named objects. py. You will define a class in objects. py to represent the structure of Point objects. The class Point type will need two attributes (named x and y); as before this means that theinit function must take these two arguments (in addition to self) and initialize the attributes within self.
Define a class to represent a circle. Add this class to the objects. py file. The class Circle type will need two attributes to represent the center point (this will be an object of the Point class) and the radius.
Be sure to test yourinit functions by creating objects and verifying that the attributes have been properly initialized. You can place the test cases in the provided funcs_ objects tests. py file.
Note that testing the fields of an object that are themselves objects requires a bit more work than one might initially expect. For instance, when verifying that a circle has been properly initialized, you should not compare the center to another Point, but should instead compare each field of the center point (i. e., the center. x and center. y components) to the expected values. Comparing objects directly can be done, but doing so is beyond the scope of this lab.
Functions on Point and Circle
In the funcs_objects directory create a file named funcs_objects. py. Place your test cases in the provided funcs_objects_tests. py file.
If you wish to use any of the functions from the previous part, you will find that the simplest approach at this time is to copy your funcs. py file to this directory. To do so, from within the funcs_objects directory, type cp ../funcs/funcs. py . (the . (dot) at the end of that command is important; it signifies the current directory as the destination of the copy).
You must provide at least two test cases for each of these functions. In order to test these functions, you will first need to create an appropriate number of objects and then call the function that you wish to test. If an object is to be returned, then you will need to assign the result to a variable and test each field independently.
distance
Write a function, named distance, that takes two arguments of type Point and that returns the Euclidean distance between these two points.
circles_overla
Write a function, named circles_overlap, that takes two arguments of type circle and that returns True when the circles overlap and False otherwise (consider circles touching at the edge as non-overlapping). You must write this function using a relational operator and without using any sort of conditional.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
Aprovides legal protection for something an individual has created
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
"it security policy enforcement and monitoring" respond to the following: describe how monitoring worker activities can increase the security within organizations. describe the rationale that managers should use to determine the degree of monitoring that the organization should conduct. explain the extent to which you believe an organization has the right to monitor user actions and traffic. determine the actions organizations can take to mitigate the potential issues associated with monitoring user actions and traffic.
Answers: 3
question
Computers and Technology, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
You know the right answer?
Functions on Structured Data This part will be executed with: python funcs_objects tests. py
...
Questions
question
Mathematics, 02.01.2022 08:40
question
English, 02.01.2022 08:50
question
Mathematics, 02.01.2022 08:50
Questions on the website: 13722367