Advertisement
Spocoman

02. Grades

Jan 24th, 2022
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve (grade) {
  2.    
  3.     let grades = grade >= 2 && grade < 3.00 ? 'Fail':
  4.         grade >= 3 && grade < 3.50 ? 'Poor':
  5.         grade >= 3.50 && grade < 4.50 ? 'Good':
  6.         grade>=  4.50 && grade < 5.50 ? 'Very good':
  7.         grade >= 5.50 ? 'Excellent': "";
  8.    
  9.     console.log(`${grades.valueOf(grade)} (${ grade < 3? 2 : grade.toFixed(2)})`);
  10.    
  11. }
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement