Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function poolTubes([argV, argP1, argP2, argH,]) {
- let VolumePool = parseInt('argV');
- let FirstTube = parseInt('argP1');
- let SecondTube = parseInt('argP2');
- let hours = parseFloat('argH');
- let FillPullFirstTube = FirstTube * hours;
- let FullPullSecondTube = SecondTube * hours;
- let Totalpool = FillPullFirstTube + FullPullSecondTube;
- let TotalPorcent = Totalpool / VolumePool * 100;
- let FistTubePorcent = FillPullFirstTube / FullPullSecondTube * 100;
- let SecondTubePorcent = FullPullSecondTube / FullPullSecondTube * 100;
- if (VolumePool < Totalpool) {
- console.log('The pool is' + 'TotalPorcent' + '% full. Pipe 1:'+ 'FistTubePorcent' + '%. Pipe 2:' + 'SecondTubePorcent' +'%.');
- } else if (VolumePool > Totalpool) {
- let Flout = Totalpool - VolumePool;
- console.log('For' + 'hours' + 'hours the pool overflows with' + 'Flout' + 'liters.');
- } else {
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement