Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need assistance with how to go about solving this problem(C++), Thanks! Except for constants (such as const int x=100), this job may not use global
Need assistance with how to go about solving this problem(C++), Thanks! Except for constants (such as const int x=100), this job may not use global variables, otherwise it will not be scored. Topic: Arrange the itinerary for each team for the daily work of the logistics industry. For example, consider a company with 100 items that need to be delivered to 100 customers. Each customer's location is different, the weight of each item is also different, and the vehicle also has a load limit. How to assign all the shipments to each vehicle at this time is a complicated problem. This series of semester assignments will lead you to write a program with some intelligence to help the company staff to make assignments.
Description: 1. The customer's profile can be found in the HW2_node.txt file. File content format HW2_node.txt 0 35.99 600.00 600.00 1 7.95 164.01 27.54 2 36.87 471.76 330.05 3 30.10 836.22 293.19 4 44.83 560.72 887.62 5 11.76 163.59 490.98 6 27.07 726.08 618.92 7 47.03 896.93 161.00 8 9.43 431.29 502.20 9 47.97 256.06 799.50 10 19.78 59.37 433.31 11 45.43 638.43 1139.54 12 7.68 135.55 1123.36 13 33.57 406.76 624.48 14 14.86 737.69 785.56 15 30.97 120.12 20.14 16 29.50 774.16 153.43 17 45.61 260.77 916.15 18 23.05 179.34 717.73 19 33.23 971.06 1148.32 20 48.16 796.99 1032.62 21 45.55 711.67 343.92 22 43.58 737.20 132.29 23 21.05 826.55 872.11 24 10.06 949.86 575.91 25 28.06 32.50 740.03 26 28.52 1160.64 484.01 27 37.60 1054.68 1091.43 28 20.05 721.34 992.80 29 33.06 1169.41 502.63 30 32.14 785.80 451.72 31 5.42 475.76 1053.83 32 31.87 161.96 631.67 33 22.57 816.57 690.40 34 46.06 972.41 909.21 35 24.16 170.42 331.57 36 40.73 233.29 1053.30 37 6.18 676.52 242.18 38 33.44 884.75 181.04 39 25.99 311.99 203.70 40 42.48 305.23 41.38 41 11.56 378.37 463.40 42 23.07 624.20 1122.93 43 16.60 1017.05 983.03 44 36.51 542.42 745.59 45 13.96 711.36 1049.65 46 11.59 983.77 907.76 47 36.60 617.19 683.18 48 11.82 126.35 181.04 49 5.99 760.78 401.27 50 29.56 1008.23 619.52 51 36.40 336.35 1051.67 52 13.42 574.46 742.15 53 6.78 343.99 103.65 54 29.86 948.51 724.49 55 14.27 919.23 384.46 56 48.39 768.03 116.15 57 11.72 205.29 266.85 58 43.88 406.58 300.63 59 25.65 1039.92 1014.57 60 18.80 962.81 132.51 61 41.83 987.06 291.32 62 39.19 678.04 449.99 63 8.59 985.72 580.12 64 26.04 1143.78 97.46 65 24.11 26.23 358.72 66 14.05 279.92 315.46 67 23.04 686.11 257.76 68 18.37 685.58 133.60 69 21.74 1055.85 167.73 70 32.38 1063.21 783.01 71 39.27 206.71 960.94 72 26.49 477.49 604.41 73 5.65 851.30 714.82 74 14.76 550.53 788.46 75 7.88 388.10 263.03 76 49.00 553.75 1103.75 77 46.27 381.80 1000.02 78 23.84 658.93 149.75 79 21.75 149.71 485.85 80 22.31 188.51 170.35 81 26.83 1026.78 97.60 82 49.93 327.32 804.00 83 42.38 898.88 112.79 84 17.09 456.22 367.50 85 27.25 937.29 1112.17 86 35.02 1049.40 649.19 87 36.00 644.45 1007.13 88 15.68 1136.56 167.41 89 29.97 822.45 778.97 90 41.00 950.95 871.62 91 36.92 1016.06 115.23 92 42.60 84.71 480.86 93 6.52 600.76 670.18 94 40.44 612.83 77.63 95 38.38 507.76 455.08 96 47.65 866.66 311.64 97 26.38 836.61 565.25 98 45.68 918.56 750.90 99 38.54 627.10 789.24 Each column is a customer's profile with a total of 4 pages. In order: Customer ID: Whole stream number Weight of customer goods: floating point Customer coordinates: X and Y, both floating point 2. Point 0 is the company's base, with coordinates at (600.00, 600.00). 3. This job must use the main() function provided, and its contents must not be changed. 4. This job must use the following structure to store each customer's data.
Operating program requirements: 1. Please use the main() function below.
2. Please complete the function ReadNodeFile(). This function is to retrieve the given file HW2_node.txt and return the data. 3. Please note that there is no data note in HW2_node.txt. Your program must be able to accept a variety of different pen files. In order to achieve this goal, the program must calculate the data of the data in the file by itself, and it is not allowed to write the data to the program. 4. Please use the main() function below:
5. Please complete the program requirements. 6. Please complete the CalculateDistance() function. This function accepts the customer's point and the struct sNode array with the customer data, dynamically creates a one-dimensional array of double patterns, calculates the straight line distance between all customer points, and stores the one-dimensional array. Then, return the starting address of this array. 7. Note how the distance between the points is obtained in the main() function provided, and how the two-dimensional array is achieved in a one-dimensional array. Your CalculateDistance() function should be used to properly store the distances in the array in this way.struct sNode double load, x, y; /7Name of the output file const char *inFileName- "HW2 node.txt" int ReadNodeFile (const char *fileName, struct sNode **nodeList) int main () int nNodes struct sNode *nodeList nNodes ReadNode File (inFileName, &node List); cout
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