In order to improve the level of craftsmanship and increase sales revenue, a handicraft company has formulated product s
Posted: Wed Apr 27, 2022 3:34 pm
In order to improve the level of craftsmanship and
increase sales revenue, a handicraft company has formulated
product sales rules. The rules are as follows (T: product production time
actual sales price, M: raw material price): T<2h, S-M 1.1
2h<-T<4, S-M*1.2
4h<-T<6h, S-M*1.3
6h<=T<8h, S-M*1.4
8h<-T<10h, S-M*1.5
10h<-T, S-M*1.6
For example: the raw material price of a certain commodity is 168 yuan
the production time is 3 hours, and the corresponding sales price is:
168 1.2-201.6 yuan.
Please design a program that calculates and displays the actual selling
price of an item
Require:
(1) Enter the commodity price (in yuan) and the production time; (2) Calculate and output the actual sales price of the product;
(3) The output format is required to be accurate to two decimal places
(assuming the input is 168, the output is: the actual sales price is 201.6
yuan).
Example: printf("%.2f", price) can make the value of price (float type)
accurate to two decimal places.
increase sales revenue, a handicraft company has formulated
product sales rules. The rules are as follows (T: product production time
actual sales price, M: raw material price): T<2h, S-M 1.1
2h<-T<4, S-M*1.2
4h<-T<6h, S-M*1.3
6h<=T<8h, S-M*1.4
8h<-T<10h, S-M*1.5
10h<-T, S-M*1.6
For example: the raw material price of a certain commodity is 168 yuan
the production time is 3 hours, and the corresponding sales price is:
168 1.2-201.6 yuan.
Please design a program that calculates and displays the actual selling
price of an item
Require:
(1) Enter the commodity price (in yuan) and the production time; (2) Calculate and output the actual sales price of the product;
(3) The output format is required to be accurate to two decimal places
(assuming the input is 168, the output is: the actual sales price is 201.6
yuan).
Example: printf("%.2f", price) can make the value of price (float type)
accurate to two decimal places.