Write a complete C++ program that helps a clerkat Muscat Post Office, to do the following tasks: Record each mailing package's weight 1- Calculate and store each package's delivery cost 2- 3 Calculate...


Write a complete C++ program that helps a clerkat Muscat Post<br>Office, to do the following tasks:<br>Record each mailing package's weight<br>1-<br>Calculate and store each package's delivery cost<br>2-<br>3 Calculate the average weight of all the packages.<br>Calculate the total cost of all packages greater than or equal to<br>the cost of average weight.<br>4<br>Your program should include the following functions:<br>1 Function called packageRead is used to read the weight of the<br>packages from a file named “weights.txt

Extracted text: Write a complete C++ program that helps a clerkat Muscat Post Office, to do the following tasks: Record each mailing package's weight 1- Calculate and store each package's delivery cost 2- 3 Calculate the average weight of all the packages. Calculate the total cost of all packages greater than or equal to the cost of average weight. 4 Your program should include the following functions: 1 Function called packageRead is used to read the weight of the packages from a file named “weights.txt" and store them into an array called Packages. It returns the number of package read from input file. The total number of packages cannot be more than 10. 2 Function cal_Costs is used to calculate the cost of each package 'and store it in another array called Cost based on the following rules: - If the weight is less than or equal to 1 KG, the cost is 3 OMR - If the weight is greater than 1 KG but less than or equal to 3 KG, the cost is 2 S OMR for each KG. * If the weight is greater than3 KG, the cost is 1.9OMR for each KG This function also outputs the cost of each package and total Cost to the o
E learning services<br>SQU Libraries<br>SOU Portal Attendance English (en<br>3. Function Average is used to find the average weight of all<br>packages and output the value of the average weight to the output<br>file named

Extracted text: E learning services SQU Libraries SOU Portal Attendance English (en 3. Function Average is used to find the average weight of all packages and output the value of the average weight to the output file named "results.txt". 4. Function FindCost is used to output the total cost of all packages greater or equal the cost of average weight in a file called "results.txt". Hint: Use the following function prototype. int packageRead(double 1); void cal_Costs(double], double), int), double Average(double ], int); void FindCost(double ), double 0, int); Run sample is given in results.txt file as shown below. results.txt Package O costs:5 OMR. Package I costs :7.5 OMR Package 2 costs : 24.7 OMR. Package 3 costs : 3 OMR. Package 4 costs 9.5 OMR. Package 5 costs 3,75 OMR. Package 6 costs : 145.54 OMR. Package 7 costs: 43.7 OMR Total Costs: 242.69 OMR. Average Weight: 15.6 OMR. Total cost of all packages greater than or equal to the cost of average weight 15.6 Kg 189.24 OMR weights.tst 3. 13 07 15 16.6 21 Paragraph
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here