subject
Computers and Technology, 10.05.2021 17:50 yay47

Complete the Rectangle class. It has a rectangle's length and width as class variables and contains methods to compute its area and perimeter. If either parameter is negative, the method should calculate based on its absolute value. Then, you'll take user inputs to create an instance of Rectangle. For example, if you provide the input -13 7 You should receive the output Perimeter = 40.0 Area = 91.0 Note: It is NOT necessary to use the math module to calculate absolute value, though you may if you want. 298800.1775650.qx3zqy7 LAB ACTIVITY 28.4.1: Final Exam 2021 - Problem 4 of 6 0/10 main. py Load default template... 1 class Rectangle: _init__(self, length, width): # your code here 4 5 def area (self): 6 # your code here 7 8 def perimeter (self): 9 # your code here 10 11 if _name__ == '__main__': 12 1 = float(input) 13 w = float(input) 14 r = Rectangle(1, w) 15 print("Perimeter =', r. perimeter()) 16 print('Area =', r. area(), end='')|

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:30, jacob7542
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
image
Computers and Technology, 23.06.2019 13:00, torresnoemi899
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
image
Computers and Technology, 24.06.2019 09:50, potatocow
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
You know the right answer?
Complete the Rectangle class. It has a rectangle's length and width as class variables and contains...

Questions in other subjects:

Konu
History, 01.06.2021 17:20
Konu
Mathematics, 01.06.2021 17:20
Konu
Mathematics, 01.06.2021 17:20