A shipping company maintains a file “Weights.txt” that contains the individual
weights in kg to 1 decimal place of a number of parcels. The maximum parcel
weight allowed is 20 kg. Postage stamps are available in denominations of €3,
€6, €9 and €12. The postage cost in euro for each parcel depends upon its
weight as per the following table ;
0kg – 5kg 3.00
5.1kg – 10kg 6.00
10.1kg – 15kg 9.00
15.1kg – 20kg 12.00
Write a program that
a) reads the contents of the file “Weights.txt” and counts the number of
stamps of each denomination required.
b) displays the number of stamps of each denomination required
c) calculates and displays the total cost of all the stamps.