Question: Question 1 Peter wants to send a box containing a painting to London. The Post Office sends parcels to London via GlobalMail or DHL .
Question
Peter wants to send a box containing a painting to London. The Post Office sends parcels to London via GlobalMail or DHL If GlobalMail is chosen, the cost is per if the parcel goes to zone to in London, and R per kg if the parcel goes to zone to If DHL is chosen, the actual weight is compared to the volumetric weight, and whichever is the higher weight, is used in the calculation. The volumetric weight is calculated by the formula length width height where length, width and height is the size of the box in The cost per for DHL is R
Write a program that will calculate the price to be paid for sending a parcel to London. The program must use two overloaded functions, each named calcPostage. The user must be asked if he wants to use GlobalMail or DHL Define a char variable and ask the user to input d for DHL or g for GlobalMail. If he chooses GlobalMail, the zone must be requested. The program must validate that the zone is between and If he chooses DHL the length, width and height of the box must be requested. The first function will receive two parameters, one of type double representing the weight of the parcel, and one of type int, representing the zone. The second function will receive four parameters of type double, representing the actual weight, and the length, width and height of the box in cms The second function will first determine whether the actual weight or the volumetric weight is the highest, before calculating the cost. Both functions will return the cost in a variable of type double. The main function should then display the total cost. Define const variables where applicable.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
