Write a function that receives a key-value pair (for example: 3.5: 40 ) where the key...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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<= key <= 5). . A value must be an integer number in the range (0,100] (0< value <= 100). • The total sum of percentage values must be a maximum of 100. • Output is an object that contains accumulated Percentage and accumulatedNote properties. 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<= key <= 5). . A value must be an integer number in the range (0,100] (0< value <= 100). • The total sum of percentage values must be a maximum of 100. • Output is an object that contains accumulated Percentage and accumulatedNote properties.
Expert Answer:
Answer rating: 100% (QA)
function academicNotesnotes if typeof notes object ArrayisArraynotes Objectkeysnoteslength 0 throw n... View the full answer
Related Book For
Discovering Advanced Algebra An Investigative Approach
ISBN: 978-1559539845
1st edition
Authors: Jerald Murdock, Ellen Kamischke, Eric Kamischke
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
/** * WEB222 - Assignment 02 * * I declare that this assignment is my own work in accordance with * Seneca Academic Policy. No part of this assignment has been * copied manually or electronically...
-
How important it is to educate ourselves environmental issues impacting the future of tourism i.e., climate change The COVID-19 pandemic has changed the tourism industry forever and will impact our...
-
You are the CPA for a large firm which is having a rough year and may not make analysts' forecasts. The firm is considering changing from LIFO to FIFO as that will increase income and may put them at...
-
A square loop of wire of edge length a carries current i. Show that the magnitude of the magnetic field produced at a point on the central perpendicular axis of the loop and a distance x from its...
-
How do managers use CVP analysis to make decisions?
-
In a recent annual report, Nike reported the following information (in millions): beginning total assets $6,821; ending total assets $7,891; beginning property, plant, and equipment $2,988 (at cost);...
-
Differentiate between accelerator principle of investment and investment multiplier. Explain the determinants of induced investment in an economy. Given C=a+bY, explain "a" and "b" and then sketch...
-
Find and classify the stationary values of the function f(x, y) = sin x cos y + 2 cos x sin y in the range 0xm, x y 0syn. fxy 2 fxxfyy-fxy Type f(x,y)
-
Sue Smith recertifies the Sumner family. Their current annual income is $45,000. The current income limit to determine the eligibility of a new family their size is $37,440. Does Sue need to...
-
Steve is a 43 year old pharmacist who will be offering a pharmacy-based immunization program for the first time. His past medical history includes type 2 diabetes. His vaccination history is below....
-
Mohiam Publishing produces paperback books and had the following information available when 8,400 units were made: Administrative wages $29,400 Wages for factory workers 16,800 Paper 7,700 Rent on...
-
What was the timeline of the appeal process in Tennessee vs Garner 1985. provide citation.
-
How do individuals cultivate psychological resilience in the face of adversity, drawing upon cognitive restructuring and emotion regulation techniques?
-
A girl and a boy pull in opposite directions on strings attached to each end of a spring balance. Each child exerts a force of 20 N. What will the reading on the spring balance be?
-
"Impact of covid 19 pandemics in the mental health of selected college students of PSU" Make a statement of the problem at least 5 questions.
-
CRUZ, INC. Comparative Balance Sheets December 31, 2015 CRUZ, INC. Income Statement For Year Ended December 31, 2015 Required Use the indirect method to prepare the cash provided or used from...
-
This data set was collected by a college psychology class to determine the effects of sleep deprivation on students' ability to solve problems. Ten participants went 8, 12, 16, 20, or 24 hours...
-
Use the parametric equations x = - 3t + 1 and y = 2/t + 1 to answer each question. a. Find the x- and y-coordinates of the points that correspond to the values of t = 3, t = 0, and t = - 3. b. Find...
-
Write polar equations to create each graph. For 3b and d, you'll need more than one equation. a. b. c. d. 90 180 270 90 180 0 270 180 152 270 90 180 270P
-
Consider the data file \(m r o z\) on working wives. Use the 428 observations on married women who participate in the labor force. In this exercise, we examine the effectiveness of a parent's college...
-
Consider the data file \(m r o z\) on working wives. Use the 428 observations on married women who participate in the labor force. In this exercise, we examine the effectiveness of a parent's college...
-
The CAPM says that the risk premium on security \(j\) is related to the risk premium on the market portfolio. That is where \(r_{j}\) and \(r_{f}\) are the returns to security \(j\) and the risk-free...
Study smarter with the SolutionInn App