Question: Write a function that receives a key-value pair (for example: 3.5: 40 ) where the key (in this case: 3.5) is the note and
Write a function that receives a key-value pair (for example: 3.5: 40 ) where the key (in this case: 3.5) is the note and the value (in this case: 48) is the percentage of the respective note. The function returns an object with two properties: Hints Since the notes and percentages are entered in an object, the notes (keys) must all be different. . You can use console.log to debug the output from your solution. Requirements The function accepts an object that cannot be empty. Arrays are not allowed. Keys or values that are null, undefined or empty are not allowed. . accumulated Percentage equal to the sum of all percantages (values) accumulatedNote equal to the sum of products of each note and its corresponding percentage (key-value pairs) Make sure that the input entered is fully correct with the validations needed. . A key must be a number in the range 10.5] (0
Step by Step Solution
There are 3 Steps involved in it
function academicNotesnotes if typeof notes object ArrayisArraynotes Objectkeysnoteslength 0 throw n... View full answer
Get step-by-step solutions from verified subject matter experts
