Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from enum import Enum
- class progr_language(Enum):
- ASSEMBER = 1.0
- MACROASSEMBLER = 0.95
- HIGH = 0.85
- OVERHIGH = 0.75
- CPP = OVERHIGH
- PYTHON = OVERHIGH
- JAVASCRIPT = OVERHIGH
- CSHARP = OVERHIGH
- C = HIGH
- RUST = HIGH
- OTHER = HIGH
- ASM = ASSEMBER
- FASM = ASSEMBER
- NASM = ASSEMBER
- class work():
- def __init__(self):
- self.modules = []
- self.overall_cost = 0
- self.overall_human_hours = 0
- def add_module_by_hours(self, pl :progr_language, hr: float, cph: int = 250):
- self.overall_cost += hr * pl.value * cph
- self.overall_human_hours += hr * pl.value
- print(f'added module: lang type: {pl.name}, {hr} hours -> {hr*pl.value}hours because of language, cost per hour = {cph}')
- print(f'overall cost -> {self.overall_cost}, overall human hours -> {self.overall_human_hours}\n')
- # rate is in lines per hour
- def add_module_by_size(self, pl :progr_language, size_lines: int, rate_lines_per_hour: int, cph: int = 250):
- self.add_module_by_hours(pl, size_lines/rate_lines_per_hour, cph)
- def get_cost(self): return self.overall_cost
- def get_human_hours(self): return self.overall_human_hours
- def main():
- w = work()
- # no console input yet, just adding stuff here
- w.add_module_by_hours(progr_language.JAVASCRIPT, 40)
- w.add_module_by_size(progr_language.PYTHON, 1200, 75, 350)
- print(f'\noverall cost: {w.get_cost()}')
- print(f'overall human hours time: {w.get_human_hours()}')
- if __name__ == "__main__": main()
Advertisement
Add Comment
Please, Sign In to add comment