vkrastev97

Untitled

Jun 1st, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. let input = [
  2. 3,
  3. 26.66,
  4. 18,
  5. 13.5
  6.  
  7. ];
  8.  
  9. let print = this.print || console.log;
  10. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  11. let items = +gets();
  12. let priceOfItem = '';
  13. let discounted ='';
  14. let discount = '';
  15. let revised = '';
  16.  
  17. for(i=1 ; i<= items ; i++){
  18. priceOfItem=gets();
  19. discount = ((priceOfItem/100)*65);
  20. discount.toFixed(4);
  21. discounted = (priceOfItem - discount)*100;
  22. revised = Math.round(discounted.toFixed(2) );
  23. print((revised/100 ).toFixed(2));
  24. }
Add Comment
Please, Sign In to add comment