Advertisement
galink

Tubes

Jul 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function poolTubes([argV, argP1, argP2, argH,]) {
  2.  
  3.     let VolumePool = parseInt('argV');
  4.     let FirstTube = parseInt('argP1');
  5.     let SecondTube = parseInt('argP2');
  6.     let hours = parseFloat('argH');
  7.  
  8.     let FillPullFirstTube = FirstTube * hours;
  9.     let FullPullSecondTube = SecondTube * hours;
  10.     let Totalpool = FillPullFirstTube + FullPullSecondTube;
  11.  
  12.     let TotalPorcent = Totalpool / VolumePool * 100;
  13.     let FistTubePorcent = FillPullFirstTube / FullPullSecondTube * 100;
  14.     let SecondTubePorcent = FullPullSecondTube / FullPullSecondTube * 100;
  15.  
  16.  
  17.     if (VolumePool < Totalpool) {
  18.         console.log('The pool is' + 'TotalPorcent' + '% full. Pipe 1:'+ 'FistTubePorcent' + '%. Pipe 2:' + 'SecondTubePorcent' +'%.');
  19.     } else if (VolumePool > Totalpool) {
  20.         let Flout = Totalpool - VolumePool;
  21.         console.log('For' + 'hours' + 'hours the pool overflows with' + 'Flout' + 'liters.');
  22.     } else {
  23.         return;
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement