Question: Javascript Write and test a function named calcFnlPctg_3 that accepts a single array argument, where the array contains eight strings, each representing a score. The

Javascript

Write and test a function named calcFnlPctg_3 that accepts a single array argument, where the array contains eight strings, each representing a score. The function returns the final percentage, as usual. Use function expression syntax.

What the function should return:

let arr1 = ['125 ', ' 135 ', ' 10 ', ' 90 ', ' 90 ', ' 90, 90, 90];

let arr2 = ['95', '115', '7', '90', '83', '85', '90', '90'];

calcFnlPctg_2(arr1) -> 90.00

calcFnlPctg_2(2arr) -> 76.91

Javascript Write and test a function named calcFnlPctg_3 that accepts a singleNeed to motify this code:

let calcFnlPctg_2 = function(mt, fnl, xc, p1, p2, p3, p4, p5) { mt = Number(mt); fnl = Number(fnl); xc = Number (xc); p1 = Number(p1); p2 = Number(p2); p3 = Number(p3); p4 = Number(p4); p5 = Number(p5);

let finalPercentage = 100 * (((mt + fnl+ xc) / 300) * 0.7 + ((p1 + p2 + p3 + p4 + p5) / 500) * 0.3); return finalPercentage.toFixed(2); };

let calcFnlPctg_2 = function(mt, fnl, xc, p1, P2, P3, P4, p5) { mt = Number(mt); fnl = Number(fnl); XC = Number (XC); p1 = Number(p1); p2 = Number(p2); p3 = Number(p3); p4 = Number(p4); p5 = Number(p5); let finalPercentage = 100 * (((mt + fnl+ xc) / 300) * 0.7 + ((p1 + p2 + p3 + p4 + p5) / 500) * 0.3); return finalPercentage.toFixed (2); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!