"Program 2" title: Bonuses awarded by the enterprise according to the profit commission. Profit (I) less than or equal to $100,000, the bonus can be raised by 10%, the profit is higher than $100,000, less than $200,000, less than 100,000 of the portion of the 10% commission, higher than the portion of 100,000 yuan, Cocoa Commission 7.5%, 200,000 to 400,000, higher than 200,000 yuan of the portion, can commission 5% ; Between 400,000 and 600,000 is higher than the portion of 400,000 yuan, can commission 3%, 600,000 to 1 million, higher than 600,000 yuan portion, can commission 1.5%, higher than 1 million yuan, the portion of more than 1 million yuan by 1% Commission, from the keyboard input month profit I, the total bonus should be issued? 1. Program Analysis: Please use the axis to demarcation, positioning. Note that the bonus definition should be defined as the growth integral type. 2. Program source code: #include "stdio.h" #include "conio.h" main () {long int i; int Bonus1,bonus2,bonus4,bonus6,bonus10,bonus; scanf ("%ld", &i); Bonus1=100000*0. 1; bonus2=bonus1+100000*0.75; bonus4=bonus2+200000*0.5; bonus6=bonus4+200000*0.3; bonus10=bonus6+400000*0.15; if (i<=100000) bonus=i*0.1; else if (i<=200000) bonus=bonus1+ (i-100000) *0.075; else if (i<=400000) bonus=bonus2+ (i-200000) *0.05; else if (i<=600000) bonus=bonus4+ (i-400000) *0.03; else if (i<=1000000) bonus=bonus6+ (i-600000) *0.015; else bonus=bonus10+ (i-1000000) *0.01; printf ("bonus=%d", bonus); Getch (); }
"Program 2"