"""Calculate wage""" from rival_regions_calc import Item, WorkProduction RESOURCEPRICE = 2500 RESOURCE = Item("uranium") WP = WorkProduction(RESOURCE) WP.factory_level = 165 WP.resource_max = 25 WP.department_bonus = 6.9 WP.wage_percentage = 100 WP.tax_rate = 0 def main(): """Main function""" profit = 1 print("resource price : $ {:9}".format(RESOURCEPRICE)) print("tax rate : {:9} %".format(WP.tax_rate)) print("factory level : {:9}".format(WP.factory_level)) print("department bonus : {:9} %".format(WP.department_bonus)) print() print("profit : {:9} %".format(profit)) print() print("LVL EDU % PROFIT WAGE") for level in range(60, 101, 5): calc_wage(profit, level, (level - 30) * 14 - 350) calc_wage(profit, 93, 606) calc_wage(profit, 88, 491) calc_wage(profit, 88, 344) calc_wage(profit, 60, 30) # print_wages(base_wage, user_bonus, education_bonus) def calc_wage(profit, user_level, education_level): """Calculate procentage""" WP.user_level = user_level WP.work_exp = 80000 + 200 * education_level WP.calculate() calculated_wage = WP.wage() * RESOURCEPRICE fixed_wage = round(calculated_wage / 100 * (100 - profit)) procent = 100 / calculated_wage * fixed_wage - 100 hour_difference = round(calculated_wage - fixed_wage) * 180 # print("fixed wage : {}".format(fixed_wage)) # print("calculated wage : {}".format(calculated_wage)) # print("procent : {}".format(procent)) print("{:3} {:3}: {:6.2f} {:6,}kk {:8,}k".format( user_level, education_level, procent, round(hour_difference / 1000000), round(fixed_wage / 1000), ).replace(',', '.')) def print_wages(base_wage, user_bonus, education_bonus): """Print wages""" print("Cash wage in kk") print("Level education") education_range = range(50, 401, 25) top_row = " " for education in education_range: top_row += ",{:>4}".format(education) print(top_row) for level in range(60, 101, 2): wage_row = "{:>5} ".format(level) for education in education_range: wage = base_wage + user_bonus * (level + 1) + education_bonus * (education+ 1) wage_row += ",{}".format(int(round(wage, -6)/1000000)) print(wage_row) if __name__ == "__main__": main()