COSC 436/540 WINTER 2017 Working php arrays: (http://www.w3schools.com/php/php_ref_array.asp) Distributed: 2/9/2017 Due: 2/16/2017 Make your output READABLE. It does not have to be *perfectly* formated, but it must be easily readable. Quality of code will count. Use good coding style. Use good alignment discipline. Choose good variable names. 1. Create an array of inventory. The field names can be thought of as: name in stock per item cost "bat" 5 3.50 "ball" 4 0.50 "base" 3 5.00 "umpire" 2 10000.0 "player" 4 5000.0 The field names are not actually stored in the array of data. Use array_walk() and an appropriate user defined function (it will be very simple) to compute the total number of items in the inventory (i.e., the sum of the "in stock" attributes). Output the array and the sum of in stock items. 2. Using the same array as above, use array_map() and an appropriate user defined function to produce a new array. This new array will have the same number of rows as the original. Each row will have the value for the name field and the computed monetary value of the current in stock inventory. E.g., for the above array, produce: "bat" 17.5 "ball" 2.0 "base" 15.0 "umpire" 20000. "player" 20000. Output the array and the value of the stock. 3. Use php array function to produce 4 random Euchre hands in a game. Euchre cards are drawn from a deck with all four suits (Spades, Hearts, Clubs, Diamonds) and ranks A, K, Q, J, 10, 9. Each hand has 5 cards (there will be 4 cards not used in the hands). Obviously, the hands cannot have duplicated cards. Output the hands for three different games. 4. Is array_rand() choose_with_replacement or choose_without_replacement? 5. You start with two arrays. The first is the array as given in #1. The second is the array of orders. For a name, the number of those items that are added to the inventory. So, the first array is replaced by updating it with values from the second array. For the first array as given above, and the second array shown here: "bat" 4 "player" -1 the updated inventory is: "bat" 9 3.50 "ball" 4 0.50 "base" 3 5.00 "umpire" 2 10000.0 "player" 3 5000.0 Output the input arrays and the resulting inventory array. TURN IN: hard copy of code (or answer for #4) , given in the order 1 - 5 as assigned above. The code should be in separate files. Each file has a header with: your name, URL of this file. Screen shot of output for each file. Your solution must be in the following order and stapled into one packet: #1 code, followed by screenshot of output #2 code, followed by screenshot of output #3 code, followed by screenshot of output #4 answer #5 code, followed by screenshot of output. Quality of code will matter to the grade!