Advertisement
Spocoman

Tennis Equipment

Jan 5th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function tennisEquipment(input) {
  2.     let racketPrice = Number(input[0]);
  3.     let racketCount = Number(input[1]);
  4.     let sneakersCount = Number(input[2]);
  5.     let racketsSum = racketPrice * racketCount;
  6.     let sneackersSum = racketPrice / 6 * sneakersCount;
  7.     let price = (racketsSum + sneackersSum) + ((racketsSum + sneackersSum) * 0.2);
  8.  
  9.     console.log(`Price to be paid by Djokovic ${Math.floor(price / 8)}`);
  10.     console.log(`Price to be paid by sponsors ${Math.ceil(price * 7 / 8)}`);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement