Starting with your solution to the previous task, add the following methods to your Circle class to extend its functionality. • A method named get_diameter(self) which returns the diameter of a circle (the diameter of a circle is twice the radius). • A method named get_perimeter(self) which returns the perimeter (or circumference) of a circle (the perimeter of a circle is 2 times pi times the radius). Use math.pi to calculate the perimeter of a circle (you do not need to "import math", this has already been done for you). • A method named get_area(self) which returns the area of a circle (the area of a circle is pi times the radius squared). Submit the entire class definition (including the_init_() and set_radius() methods from the previous exercise). Note - keep a copy of your solution to this task because you will be extending it step by step in subsequent tasks. For example: Test r = Circle() print("diameter is {:.2f}, perimeter is {:.2f} and area is {:.2f} ". format( r.get_diameter(), r.get_peri r = Circle(4) print("diameter is {:.2f}, perimeter is {:.2f} and area is {:.2f} ". format( r.get_diameter(), r.get_peri

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Need Python Program

Starting with your solution to the previous task, add the following methods to your Circle class to extend its
functionality.
• A method named get_diameter(self) which returns the diameter of a circle (the diameter of a circle is twice the
radius).
• A method named get_perimeter(self) which returns the perimeter (or circumference) of a circle (the perimeter of
a circle is 2 times pi times the radius). Use math.pi to calculate the perimeter of a circle (you do not need to "import
math", this has already been done for you).
• A method named get_area(self) which returns the area of a circle (the area of a circle is pi times the radius
squared).
Submit the entire class definition (including the _init_() and set_radius() methods from the previous exercise). Note -
keep a copy of your solution to this task because you will be extending it step by step in subsequent tasks.
For example:
Test
r = Circle()
print ("diameter is {:.2f}, perimeter is {:.2f} and area is {:.2f}
". format( r.get_diameter(), r.get_peri
r = Circle(4)
print("diameter is {:.2f}, perimeter is {:.2f} and area is {:.2f} ".format( r.get_diameter(), r.get_peri
Transcribed Image Text:Starting with your solution to the previous task, add the following methods to your Circle class to extend its functionality. • A method named get_diameter(self) which returns the diameter of a circle (the diameter of a circle is twice the radius). • A method named get_perimeter(self) which returns the perimeter (or circumference) of a circle (the perimeter of a circle is 2 times pi times the radius). Use math.pi to calculate the perimeter of a circle (you do not need to "import math", this has already been done for you). • A method named get_area(self) which returns the area of a circle (the area of a circle is pi times the radius squared). Submit the entire class definition (including the _init_() and set_radius() methods from the previous exercise). Note - keep a copy of your solution to this task because you will be extending it step by step in subsequent tasks. For example: Test r = Circle() print ("diameter is {:.2f}, perimeter is {:.2f} and area is {:.2f} ". format( r.get_diameter(), r.get_peri r = Circle(4) print("diameter is {:.2f}, perimeter is {:.2f} and area is {:.2f} ".format( r.get_diameter(), r.get_peri
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education