Advertisement
DiYane

Gymnastics

Feb 22nd, 2024
1,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function gymnastics(input){
  2.  
  3.     let country = input[0];
  4.     let staff = input[1];
  5.  
  6.     if (country == 'Bulgaria'){
  7.  
  8.         if (staff == 'ribbon'){
  9.             let task = 9.600 + 9.400;
  10.             let gets = 20 - task;
  11.             let percent = (gets / 20) * 100;
  12.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  13.             console.log(`${percent.toFixed(2)}%`);
  14.  
  15.         } else if (staff == 'hoop'){
  16.             let task = 9.550 + 9.750;
  17.             let gets = 20 - task;
  18.             let percent = (gets / 20) * 100;
  19.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  20.             console.log(`${percent.toFixed(2)}%`);
  21.  
  22.         } else if(staff = 'rope'){
  23.             let task = 9.500 + 9.400;
  24.             let gets = 20 - task;
  25.             let percent = (gets / 20) * 100;
  26.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  27.             console.log(`${percent.toFixed(2)}%`);
  28.         }
  29.  
  30.  
  31.     } else if (country == 'Russia'){
  32.  
  33.         if (staff == 'ribbon'){
  34.             let task = 9.100 + 9.400;
  35.             let gets = 20 - task;
  36.             let percent = (gets / 20) * 100;
  37.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  38.             console.log(`${percent.toFixed(2)}%`);
  39.  
  40.         } else if (staff == 'hoop'){
  41.             let task = 9.300 + 9.800;
  42.             let gets = 20 - task;
  43.             let percent = (gets / 20) * 100;
  44.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  45.             console.log(`${percent.toFixed(2)}%`);
  46.  
  47.         } else if(staff = 'rope'){
  48.             let task = 9.600 + 9.000;
  49.             let gets = 20 - task;
  50.             let percent = (gets / 20) * 100;
  51.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  52.             console.log(`${percent.toFixed(2)}%`);
  53.         }
  54.    
  55.  
  56.     } else if (country == 'Italy'){
  57.  
  58.         if (staff == 'ribbon'){
  59.             let task = 9.200 + 9.500;
  60.             let gets = 20 - task;
  61.             let percent = (gets / 20) * 100;
  62.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  63.             console.log(`${percent.toFixed(2)}%`);
  64.  
  65.         } else if (staff == 'hoop'){
  66.             let task = 9.450 + 9.350;
  67.             let gets = 20 - task;
  68.             let percent = (gets / 20) * 100;
  69.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  70.             console.log(`${percent.toFixed(2)}%`);
  71.  
  72.         } else if(staff = 'rope'){
  73.             let task = 9.700 + 9.150;
  74.             let gets = 20 - task;
  75.             let percent = (gets / 20) * 100;
  76.             console.log(`The team of ${country} get ${task.toFixed(3)} on ${staff}.`);
  77.             console.log(`${percent.toFixed(2)}%`);
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement