SHARE
TWEET

Untitled

a guest Feb 21st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(examPoints, homePoints, toTalhomePoints){
  2.     if(examPoints == 400){      
  3.         console.log(6.00.toFixed(2));
  4.     } else {
  5.         let homeBonus = homePoints / toTalhomePoints * 10;
  6.         let totalPoints = (examPoints * 90) / 400 + homeBonus;
  7.         let grade = 3 + 2 * (totalPoints - 100 / 5) /  (100 / 2);
  8.         if(grade < 3.00){
  9.             grade = 2;          
  10.         }
  11.         if(grade > 6.00){
  12.             grade = 6;            
  13.         }
  14.         console.log(grade.toFixed(2));
  15.     }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top