Advertisement
mark79

Weather Forecast - Part 2

May 18th, 2019
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function WeatherForecastPart2(input) {
  2.     let deg = Number(input.shift());
  3.     if (deg >= 26 && deg <= 35) {
  4.         console.log(`Hot`);
  5.     } else if (deg >= 20.1 && deg <= 25.9) {
  6.         console.log(`Warm`);
  7.     } else if (deg >= 15 && deg <= 20) {
  8.         console.log(`Mild`);
  9.     } else if (deg >= 12 && deg <= 14.9) {
  10.         console.log(`Cool`);
  11.     } else if (deg >= 5 && deg <= 11.9) {
  12.         console.log(`Cold`);
  13.     } else {
  14.         console.log(`unknown`);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement