Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
Testing a partial prorogram: Why is Modulus function not working?

const marks = [80];
const grade = ['A', 'B', 'C', 'D', 'F'];

let sum = 0;

console.log(checkGrade(marks));

function checkGrade(array) {
  for (let item of array)
    sum += item;
  const avg = sum / array.length;
  let gradePoint = Math.floor((100 - avg) / 10);
  return gradePoint % 10;
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

as Your code, the avg is = 80

and (100-avg) / 10 = 2 which is gradePoint

and you are returning gradePoint % 10

that means 2 % 10

which is returning 2. and it is working perfectly. Where is the issue?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!