Question: Lab 8 Task Opened: Friday, 14 January 2022, 12:00 AM Due: Tuesday, 18 January 2022, 8:00 AM Mark as done 1. 2. . Create a

 Lab 8 Task Opened: Friday, 14 January 2022, 12:00 AM Due:
Tuesday, 18 January 2022, 8:00 AM Mark as done 1. 2. .
Create a Cricle class and initialize it with radius. Make two methods

Lab 8 Task Opened: Friday, 14 January 2022, 12:00 AM Due: Tuesday, 18 January 2022, 8:00 AM Mark as done 1. 2. . Create a Cricle class and initialize it with radius. Make two methods getArea and getCircumference inside this class. Create a Student class and initialize it with name and roll number. Make methods to : Display - It should display all information of the student. setAge . It should assign an age to student setMarks - It should assign marks to the student. Write a class named Rectangle constructed by a length and width and a method that will compute the area of a rectangle 3. SOLUTION: class Circle(): def __init__(self, radius): self.radius radius def getArea(self): return 3.14'self.radius"self.radius def getCircumference(self): return self.radius*23.14 class Student() def __init__(self, name,roll): self.name = name self.roll= roll def display(self): print self.name print self.roll def setAge(self, age): self.age=age def setMarks(self,marks): self.marks = marks class Rectangle(): def __init__(self, I, w): self.length = 1 self.width = w def rectangle_area(self): return self.length*self.width newRectangle = Rectangle(12, 10) print(new Rectangle.rectangle_area())

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!