Question 2 (40 points)
Given the following program...
def main():
SKU_123 = Pants(32, 34, 44.95) # length, waist, price
SKU_321 = Pants(34, 30, 24.99)
SKU_999 = Pants(40, 32, 90.00)
print(SKU_123)
print(SKU_321)
tax = .07
cost = SKU_999.calc_cost(tax)
print("The fancy 999 pants cost \${amount:.2f}".format(amount=cost))
main()
...provide the missing Pants class such that running the program produces the output
below. Notice that the arguments of the Pants constructor are length, width, and
price, respectively. The Pants constructor should initialize those three attributes, and
there should also be a method calculate the cost with tax, and a __str__ method to
return a string representation of the Pants object as shown in the transcript below.
32 x 34: $44.95
34 x 30: $24.99
The fancy 999 pants cost $96.30