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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:20
What is the full meaning of rfid in computer
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesn’t exist
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
(, urgent need): how do i change my username
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
question
English, 27.07.2019 20:30
question
Mathematics, 27.07.2019 20:30
question
Mathematics, 27.07.2019 20:30
Questions on the website: 13722367