Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming C++ QUESTION 1 Write a complete C++ program to perform the following tasks: a) A delivery service charges the user based on the weight
Programming C++QUESTION 1 Write a complete C++ program to perform the following tasks: a) A delivery service charges the user based on the weight of parcels sent through their system. There are two types of parcels, identified as P01 and PO2. In the main program, the getInputs() and the charges () function are called. The total delivery charges is displayed in the main program. The user can repeat the calling functions until the user enters a sentinel value (N). b) Construct a getInputs() function that allow the user to enter the item code, weight and number of items. These inputs are passed using reference parameters to the caller function. c) Construct a charges function that has an array of character for the item code, weight, and number of items, as its parameters, and return the total delivery charges. The function calculates the total delivery charges based on the following table. Item Code Weight Delivery charges less than 500 grams RM3 per item PO1 500 gram - 3 kilograms RM5 per item more than 3 kilograms RM15 per item less than 200 grams RM3 per item PO2 200 grams - 300 grams RM4 per item more than 300 grams Display a message "Exceed the weight limit, use code P01" Total Delivery Charges = Delivery Charges x Number of Items An error message is displayed if the code is not in the list. (20 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started