#!/usr/bin/python # -*- coding: windows-1251 -*- import os, sys '''base = int(input('Enter the amount of funds allocated for the award:'))''' number_main_section = int(input("Enter the number of partitions: ")) SECTION_NUMBER = 0 while SECTION_NUMBER < number_main_section: SECTION_NUMBER += 1 def user_input_section(): section_title = input("Enter a section name (A, B, C others): ") number_subdivisions = int(input("Enter the number of subsections of the section " + str.upper(section_title) + ": ")) type_of_kpi = int(input('Enter type of KPI (quantitative - 1; qualitative - 2): ')) print("") return section_title, number_subdivisions, type_of_kpi user_input_section_list = user_input_section() CYCLE_NUMBER = 0 while not (user_input_section_list[2] in [1, 2]): print("Wrong character entered!") user_input_section_list[2] = int(input('Enter type of KPI (quantitative - 1; qualitative - 2): ')) if user_input_section_list[2] == 1: def user_input_of_section_quantitative_values(x, y): plan = int(input('Enter the target value (' + str.casefold(x) + str(y) + '): ')) fact = int(input('Enter the actual target value (' + str.casefold(x) + str(y) + '): ')) weight = int(input("Enter the weight in % (" + str.casefold(x) + str(y) + "): ")) kpi = fact / plan * 100 return plan, fact, weight, kpi while CYCLE_NUMBER < user_input_section_list[1]: CYCLE_NUMBER += 1 user_input_of_section_values_list = user_input_of_section_quantitative_values(user_input_section_list[0], CYCLE_NUMBER) if user_input_of_section_values_list[1] > user_input_of_section_values_list[0] * 1.1: coefficient_value = 0 elif user_input_of_section_values_list[0] * 1.02 < user_input_of_section_values_list[1] <= user_input_of_section_values_list[0] * 1.1: coefficient_value = user_input_of_section_values_list[2] * 0.8 / user_input_of_section_values_list[3] elif user_input_of_section_values_list[0] * 0.97 < user_input_of_section_values_list[1] <= user_input_of_section_values_list[0] * 1.02: coefficient_value = user_input_of_section_values_list[2] * 1.05 / user_input_of_section_values_list[3] else: coefficient_value = user_input_of_section_values_list[2] * 1.2 / user_input_of_section_values_list[3] if coefficient_value == 0: print("The value of the coefficient " + str(user_input_section_list[0]) + str(CYCLE_NUMBER) + ": 0 \n") else: print(str(round(coefficient_value, 3)) + "\n") elif user_input_section_list[2] == 2: def user_input_of_section_qualitative_values(x, y): weight = int(input("Enter the weight in % (" + str.casefold(x) + str(y) + "): ")) kpi = int(input("Enter an assessment of the quality of the work performed (" + str.casefold(x) + str(y) + "): ")) return weight, kpi while CYCLE_NUMBER < user_input_section_list[1]: CYCLE_NUMBER += 1 user_input_of_section_values_list = user_input_of_section_qualitative_values(user_input_section_list[0], CYCLE_NUMBER) coefficient_value = (user_input_of_section_values_list[0] / 100) * user_input_of_section_values_list[1] / 3 if coefficient_value == 0: print("The value of the coefficient " + str(user_input_section_list[0]) + str(CYCLE_NUMBER) + ": 0 \n") else: print(str(round(coefficient_value, 3)) + "\n") else: print('Wrong character entered!') '''k = A * 0.4 + B * 0.4 + C * 0.2 [code python][code python][/code][/code] premiya = base * k print(str(premiya))'''