Skip to content

Commit 4de7ee2

Browse files
committed
pay calculater
1 parent 337c658 commit 4de7ee2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

newcodes/answers/q62.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
# coding=utf-8
3+
4+
class PayCalculator:
5+
def __init__(self, pay_rate):
6+
self.pay_rate = pay_rate
7+
8+
def compute_pay(self, hours):
9+
total_pay = self.pay_rate * hours
10+
return round(total_pay, 2)
11+
12+
if __name__ == "__main__":
13+
worker = PayCalculator(25.7)
14+
total = worker.compute_pay(8)
15+
print(total)

0 commit comments

Comments
 (0)