Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to calculate Enterprise bonus profit in python

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to calculate the enterprise bonus profit in python, aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Topic: the bonus paid by the enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus is 10%; when the profit is more than 100000 yuan, the part below 100000 yuan is 10%, and the part higher than 100000 yuan is 7.5%; between 200000 and 400000, the part higher than 200000 yuan is 5%; the part between 400000 and 600000 is higher than 400, 000 yuan, 3% Between 600000 and 1 million, 1.5% is allowed for the part above 600000 yuan, and 1% for the part exceeding 1 million yuan when it is higher than 1 million yuan. Enter the monthly profit I from the keyboard and ask for the total amount of bonus that should be paid.

Program analysis: please use the number axis to demarcate and locate. Note that the bonus should be defined as a growth integer.

Program source code:

I = int (input ('net profit:') arr = [1000000, 600000, 400000, 200000 and 1000000] rat = [0.01, 0.015, 0.03, 0.075, 0.1] r = 0for idx in range (0Power6): if I > arr [idx]: r = (i-arr [idx]) * ratidx] I = arr [IDX] print (r)

Please run the program in python3 environment.

Program output:

Net profit: 22222.200000000000003 this is the answer to the question about how to calculate the corporate bonus profit in python. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report