I cannot seem to understand how to use if/else in the following question:
● You need to design a program for a courier company to calculate the cost of sending a parcel. ● Ask the user to enter the price of the package they would like to purchase. ● Ask the user to enter the total distance of the delivery in kilometers. ● Now, add on the delivery costs to get the final cost of the product. There are four categories to factor in when determining a parcel’s final cost, each with two options based on the customer’s delivery preferences. (Use an if else statement based on the choice they make) ○ Delivery via air ($0.36 per km) or via freight ($0.25 per km) ○ Full insurance ($50.00) or limited insurance ($25.00) ○ Gift option ($15.00) or not ($0.00) ○ Priority delivery ($100.00) or standard delivery ($20.00) ● Write code to work out the total cost of the package based on the options selected in each category.
Can anyone help? Thank you.
Aucun commentaire:
Enregistrer un commentaire