Assignment title: Management


1 Write a MATLAB script that calculates the cost of shipping a package according to the following price schedule. The program asks the user to enter the type of service (Ground, Express, or Overnight) and the weight of the package (two number. the first number for pounds and the second number for ounces). The program then displays the cost for the shipment. Run the program for continuous for three times to calculate following cases: (a) Ground 3 lb 8 oz (b) Express 0 lb 6 oz (c) Overnight 6 lb 11 oz Given that: 1 lb = 16 oz Question 2 The handicap differential (HCP) for a round of golf is calculated from the formula: The course rating and the slope are measures of how difficult a particular course is. A golfers handicap is calculated from a certain number 𝑁 of their best (lowest) handicap scores according to the Table 1. For example, if 13 rounds have been played, only the best five handicaps are used. A handicap cannot be computed for the fewer than five rounds. If more than 20 rounds have been played, only the 20 most recent results are used. Once the lowest 𝑁 handicap differentials have been identified, they are averaged and then rounded down to the nearest tenth. The result is player's handicap. (a) Write a MATLAB program in a script file that calculates a person's handicap. The program asks the user to enter the golfers record in a three columns matrix where the first column is the course rating, the column is the course slope, and the third is the player's score. Each row corresponds to one round. The program displays the person's handicap, the number of rounds have been played and the three column matrix. Write a report to explain the method you are using. ) Execute the program for the players with the following records Question 3 A railway wagon, moving with velocity 𝑣, strikes a viscously damped buffer. The equation of motion is given by: Where 𝑣(𝑡) is the velocity of the wagon at time 𝑡. Assume that the values of the mass 𝑚, damping 𝑐, and initial velocity 𝑣(0) as 𝑚 = 5000 kg, 𝑐 = 15000 Ns/m, and 𝑣(0) = 3 m/s (a) Write a MATLAB code to calculate the velocity of the wagon at 𝑡 = 2 second by using 4 th order Runge-Kutta method, Euler Explicit and Euler Implicit. All plots must be plotted in the same figure. Start with the step size of 1. Your code must show the velocity with respective time for all three methods in the command window. (b) Repeat your calculation in (a) with another two step sizes, i.e., 0.5 and 0.1. Discuss your solutions. Section B 1 Each of the two tanks shown in Figure 1 contain 100 gallons of water. The water in tank 1 contains 1000 grams of dissolved salt, while the water in tank 2 contains 100 grams of dissolved salt. At time t = 0, pipe 1 starts pumping pure water at the rate of 10 gallons/minute, while pipes 2, 3, and 4 start pumping mixed water at rates 15, 5, and 10 gallons/minute, respectively, in the directions indicated in Figure 1. The concentration of the tanks 1 and 2 are represent by the following differential equations: Apply 4 th order Runge-Kutta (RK) method to find the concentration of the salt in the tanks at t = 3 mins with the step size of 1 (solve manually). (b) Write a MATLAB code to find the concentration of the salt in the tanks at t = 50 mins with the step size of 1. List out all the RK solutions and plot the graph. (c) Using the code in part (b), find the time (in 2 decimal places) when the concentration of both tanks are same by showing it in the graph. (d) Using the same code in part (b), find the time (in 2 decimal places) when the concentration of both tanks is below 2. Display clearly your solution in the graph.