second.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //EVALUTION
  2. let a = 5;
  3. let b, c;
  4. b = ((a) * (5));
  5. b = ((c) = ((b)/(2)));
  6. //AGE
  7. let age = prompt ('How old are you?')
  8. let year = (2022 - age )
  9. alert("You were born in " + year)
  10. //TEMPERATURE
  11. let temp = prompt ("How many degrees (C) ?") //Celciy
  12. let far = ((temp * (9/5)) + 32) // formula of C in Farengeit
  13. alert(far + "F")
  14. //DIVIDE
  15. let number1 = prompt("your fisrt number");
  16. let number2 = prompt("your second number");
  17. result = Math.floor(number1/number2);
  18. alert(result);
  19. //CURRENCY
  20. const rate = 36.372 ;// UAH
  21. let amount = prompt("Your amount dollars") ;// $
  22. let results = rate * amount;
  23. alert("In UAH: " + results.toFixed(2))
  24. //RGB
  25. const red = 255;
  26. let ared; // answer for color in (16)
  27. ared = red.toString(16);
  28. const green = 225;
  29. let agreen;
  30. agreen = green.toString(16);
  31. const blue = 249;
  32. let ablue;
  33. ablue = blue.toString(16);
  34. alert('Color in (16) : ' + ared + agreen + ablue );
  35. //FLATS
  36. let floors = 9 ;
  37. let flats = 4 ;
  38. let need = prompt('1 - last number of flats in build') ;
  39. let need_fl = need % (flats * floors);
  40. let number_flo = Math.ceil(need_fl / 4);
  41. let entrance = Math.ceil(need/(floors*flats))
  42. alert( 'You need floor № ' + number_flo + " Entrance № " + entrance )