Question: By using python language please .. thank you .. niti A seller keeps a record for each purchase in a text file. Each line in

By using python language please ..
thank you ..  By using python language please .. thank you .. niti A
seller keeps a record for each purchase in a text file. Each

niti A seller keeps a record for each purchase in a text file. Each line in the file contains six items. The ID, the product description, the quantity, the unit price, the discount code (one of the letter 'S', 'For 'N), and the discount rate (between 0-25%). Items are rated by colons. Figure.1 shows a sample input file 2145:Socks:5:1.1:5:0.20 5896:Jacket:5:60.50:L:0.10 6321:Belt:40:12.1:F:0.9 4552:Tee-Shirt:15:-4.25:F:0.12 2356:Shirt:5:10.2:M:0 2589:Veil:60:7.1:5:0.15 cure, e input It is worth mentioning that the discounted price is calculated on the basis of the discount code, the discount rate, and in some instances the quantity. Hence, based on cach of the following discount code, the discounted price is calculated as follows: 1 S: a standard discount is applied. Discounted price Unit Price x (1-discount rate). 2 'F' : a full discount is applied. If the quantity is less than 50 then the Discounted price = unit Price x (1-3 x discount rate) otherwise Discounted price-unit Price /3 3. 'N :no discount will be applied

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!