/*商店销售某一商品呢,商店每天公布统一的折扣(discount),同时允许销售人员在销售时灵活掌握折扣(price),在此基础上,对一次购10件以上者,还可以享受9.8折,现已知当天3名销售货员销售情况为:销货员号(num)销货件数(quantity)销货单价(price)101523.51021224.5610310021.5请编写程序,计算出当日此商品的总销售款sum,以及每件商品的平均售价,要求用静态数据成员和静态成员函数。(将折扣discount、总销售款sum和商品销售总件数n声明为静态数据成员,在定义静态成员函数average(求平均售价)和display(输出结果)。)#includeiostreamusingnamespacestd;classDiscount{public:Discount(intn,intq,floatp):num(n),quantity(q),price(p){}staticvoiddisplay();staticvoidD_Sum(Discount);staticfloataverage();private:intnum;intquantity;floatprice;staticfloatsum;staticfloatdiscount;staticintScount;};floatDiscount::sum=0;floatDiscount::discount=0.95;intDiscount::Scount=0;voidDiscount::D_Sum(DiscountSale){floattmp;if(Sale.quantity=10){tmp=Sale.quantity*Sale.price*discount*0.98;sum+=tmp;}else{tmp=Sale.quantity*Sale.price*discount;sum+=tmp;}Scount+=Sale.quantity;}floatDiscount::average(){returnsum/Scount;}voidDiscount::display(){coutendl;cout当日此商品的总销售款为:sumendl;cout当日此商品的平均售价为:average()endl;coutendl;}voidmain(){DiscountSale[3]={Discount(101,5,23.5),Discount(102,12,24.5),Discount(103,100,21.5)};for(inti=0;i3;i++){Discount::D_Sum(Sale[i]);}Discount::display();}*/