Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Would Solution Numbers 1 2 3 Javascript Python Q35574341

What would be the solution for numbers 1, 2 & 3 injavascript and python?
Write both JavaScript (util.js) and Python Code (util.py) for the following questions. We recommend that you use another fileWrite both JavaScript (util.js) and Python Code (util.py) for the following questions. We recommend that you use another file (testUtil.js and test Util.py) to test the functionality of the code written. However, only the util files will be evaluated using our testing suite. Questions 1 to 3 are based on Figure 1 name”: “John” “sex”: “m” country”:”tt products”: “name”: “Peanut”, “category”:”food” “value”: 15, “date”: “2019-03-12 Figure 1-Structure of a record 1. Write a function called “getMostValuable” that accept an array/list of customer records stored as object-literals/dictionaries. Each record has a field called ‘products which stores additional records that contain the fields ‘name’ and value. This structure is illustrated in Figure 1. The function “getMostValuable” will return the position of the most valuable record 2. Write a function called “addCustomer” that will add a new customer record to a sorted array/list of customer records. The structure of the customer record is provided in Figure 1. The records are sorted in ascending order based on the name field of the customer record [51 3. Write a function called “getBySex” that accepts an array/list of customer records stored as object-literals/dictionaries illustrated in Figure 1. The function will return an array/list that contains customers that matches the sex specified as a parameter. The function will accept both the word [‘male’, ‘female’l or the letter [‘m’, ‘f] as valid inputs. 5 Show transcribed image text Write both JavaScript (util.js) and Python Code (util.py) for the following questions. We recommend that you use another file (testUtil.js and test Util.py) to test the functionality of the code written. However, only the util files will be evaluated using our testing suite. Questions 1 to 3 are based on Figure 1 name”: “John” “sex”: “m” country”:”tt products”: “name”: “Peanut”, “category”:”food” “value”: 15, “date”: “2019-03-12 Figure 1-Structure of a record 1. Write a function called “getMostValuable” that accept an array/list of customer records stored as object-literals/dictionaries. Each record has a field called ‘products which stores additional records that contain the fields ‘name’ and value. This structure is illustrated in Figure 1. The function “getMostValuable” will return the position of the most valuable record 2. Write a function called “addCustomer” that will add a new customer record to a sorted array/list of customer records. The structure of the customer record is provided in Figure 1. The records are sorted in ascending order based on the name field of the customer record [51 3. Write a function called “getBySex” that accepts an array/list of customer records stored as object-literals/dictionaries illustrated in Figure 1. The function will return an array/list that contains customers that matches the sex specified as a parameter. The function will accept both the word [‘male’, ‘female’l or the letter [‘m’, ‘f] as valid inputs. 5

Leave a Reply

Your email address will not be published. Required fields are marked *