当前位置:网站首页>Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase
Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase
2022-07-05 08:21:00 【Lazy smile】
example 002:“ Calculation of individual income tax ”
# ** subject :** The bonus paid by the enterprise is based on the profit commission . # profits (I) Below or equal to 10 Ten thousand yuan , Bonus can be raised 10%; # Profit is higher than 10 Ten thousand yuan , lower than 20 Ten thousand yuan , lower than 10 For the part of ten thousand yuan, press 10% Royalty , higher than 10 Part of ten thousand yuan , It's a percentage 7.5%; # 20 Wan to 40 Ten thousand hours , higher than 20 Part of ten thousand yuan , It's a percentage 5%; # 40 Wan to 60 Ten thousand times is higher than 40 Part of ten thousand yuan , It's a percentage 3%; # 60 Wan to 100 Ten thousand hours , higher than 60 Part of ten thousand yuan , It's a percentage 1.5%, # higher than 100 Ten thousand yuan , exceed 100 For the part of ten thousand yuan, press 1% Royalty , # Input the profit of the month from the keyboard I, Ask for the total amount of bonus payable ?
# Topic analysis """ When we do manual calculations , It's calculated like this : The assumption is 1500000, It is greater than 10000 Ten thousand , Now let's do it by hand : 10w*0.1+10w*0.075+20w*0.05+20w*0.03+40w*0.015+50w*0.01 """ # ** Program analysis :** Calculate between zones
According to our manual calculation process , In the algorithm, , We also calculate according to the interval , If the profit entered profit Less than or equal to thresholds[i] when , Then use profit Calculate the interest rate corresponding to the current range and add it to the bonus bonus Exit after going on , Otherwise, use the amount corresponding to the current interval * The interest rate of the corresponding range is added to the bonus bonus After the ,profit Subtract the amount corresponding to the current range and enter for loop . The interest rate in the amount range has the corresponding interval interest rate , higher than 100 The part of ten thousand corresponds to the interest rate 1% That is to say 0.01. If our profit is less than or equal to 100 Ten thousand , that profit Out of the cycle is 0, Calculated before outputting the total amount of bonus paid is higher than 100 Wan's bonus is 0*0.01=0.
for j in range(10): # You can test 10 Time
profit = int(input(' Please enter your profit amount : ')) #input The input is a string type , Use int() Turn to an integer
bonus = 0
thresholds = [100000, 100000, 200000, 200000, 400000] # Inter zone calculation
rates = [0.1, 0.075, 0.05, 0.03, 0.015, 0.01]
for i in range(len(thresholds)):
print(profit, "--", i, "thresholds[i]", thresholds[i], "rates[i]", rates[i])
if profit <= thresholds[i]:
bonus += profit * rates[i]
profit = 0
break
else:
bonus += thresholds[i] * rates[i]
profit -= thresholds[i]
print(profit)
bonus += profit * rates[-1] # Here is the calculation higher than 100w Part of the bonus
print(" The total amount of bonus paid is : ", bonus)
Output results :
Please enter your profit amount : 1500000
1500000 -- 0 thresholds[i] 100000 rates[i] 0.1
1400000
1400000 -- 1 thresholds[i] 100000 rates[i] 0.075
1300000
1300000 -- 2 thresholds[i] 200000 rates[i] 0.05
1100000
1100000 -- 3 thresholds[i] 200000 rates[i] 0.03
900000
900000 -- 4 thresholds[i] 400000 rates[i] 0.015
500000
The total amount of bonus paid is : 44500.0
边栏推荐
- Class of color image processing based on Halcon learning_ ndim_ norm. hdev
- Sql Server的存儲過程詳解
- 關於線性穩壓器的五個設計細節
- Briefly talk about the identification protocol of mobile port -bc1.2
- STM32 --- NVIC interrupt
- Circleq of linked list
- Sql Server的存储过程详解
- Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]
- Keil use details -- magic wand
- UE像素流,来颗“减肥药”吧!
猜你喜欢

STM32 single chip microcomputer - external interrupt
![C WinForm [change the position of the form after running] - Practical Exercise 4](/img/f7/ddaf5773295ca6929d39d7aa760d36.jpg)
C WinForm [change the position of the form after running] - Practical Exercise 4
![Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev](/img/42/d857452ccfeccbbf1ac34f47e47e2e.jpg)
Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev

实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?

【三层架构及JDBC总结】

Network communication process

Matlab2018b problem solving when installing embedded coder support package for stmicroelectronic
![Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine](/img/a1/d13b37955b044b6be5f1fd10263c5e.jpg)
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine

After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
![C WinForm [view status bar -- statusstrip] - Practice 2](/img/40/63065e6c4dc4e9fcb3e898981f518a.jpg)
C WinForm [view status bar -- statusstrip] - Practice 2
随机推荐
Brief discussion on Buck buck circuit
Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
Volatile of C language
Carrier period, electrical speed, carrier period variation
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
Briefly talk about the identification protocol of mobile port -bc1.2
Live555 push RTSP audio and video stream summary (I) cross compilation
NTC thermistor application - temperature measurement
STM32---ADC
STM32---IIC
UE像素流,来颗“减肥药”吧!
Count the number of inputs (C language)
关于线性稳压器的五个设计细节
实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
STM32 --- serial port communication
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
实例009:暂停一秒输出
[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl
Circleq of linked list
Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]