Answered step by step
Verified Expert Solution
Question
1 Approved Answer
12 A 1 Practice 9 use the symbols in the margin to expand question detalls; use the symbol to hide details 2 1 Sub Route():
12 A 1 Practice 9 use the symbols in the margin to expand question detalls; use the symbol to hide details 2 1 Sub Route(): create a mccro that will assgn a shipping route based on demand. In Excel, name the large table (no labels) as "RouteTable" and the small able (no labels) as "DemandTable" b In VBA, insert a new Module and create a new macro called Route Declare string variables for the destination name, the previous location name, the To node name, and the From node name 6 d Declare integer variables for the demand value, path cost, minimim path cost, number of paths, and number of destinations e Calculate the number of paths (count the values in the first column of "RouteTable') f Calculate the number of destinations (count the values in the first column of "DemandTable") g Reset all values in the third column of the "RouteTable" to Initialize the previous location variable to RA" 10 Declare two counter variables (each variable will be used for a different For, Next loop) Use a For, Next loop to check each destination and do the following: 12 Record the current name of the destination from the "DemandTable" 13 Record the demand value for the current destination from the "DemandTable" 14 If the demand value is 0 then initialize the minimum cost variable to be some large number, then start a nested For, Next loop for each path: For each path, record the From node name, To node name, and path cost from the "RouteTable" 16 n If the current To node name the current destination name then check the following: 17 p If the current path cost is the minimum cost value And the From node name the previous location name Then 18 Set the path assignment value for the current row in "RouteTable" 1 19
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