SHARE
TWEET

Untitled

a guest Sep 15th, 2016 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double volume = double.Parse(Console.ReadLine());
  14.             double pipe1= double.Parse(Console.ReadLine());
  15.             double  pipe2 = double.Parse(Console.ReadLine());
  16.             double hours = double.Parse(Console.ReadLine());
  17.  
  18.             double volumePipe1 = pipe1 * hours;
  19.             double volumePipe2 = pipe2 * hours;
  20.             double volumePipes = volumePipe1 + volumePipe2;
  21.             double volumeProcent = volumePipes/ 100.0;
  22.             double volumePipe1Procent =volumePipe1/volumeProcent;
  23.             double volumePipe2Procent =volumePipe2/volumeProcent;
  24.            
  25.  
  26.             double volume1Procen = volume / 100.0;
  27.             double volumePoolProcent = volumePipes / volume1Procen;
  28.             if (volumePipes < volume)
  29.             {
  30.                 Console.WriteLine("The pool is " + Math.Floor(volumePoolProcent) + '%' +
  31.                                 " full." + " Pipe 1: " + Math.Floor(volumePipe1Procent) + "%." +
  32.                                 " Pipe 2: " + Math.Floor(volumePipe2Procent) + "%.");
  33.  
  34.             }
  35.  
  36.             else  if (volumePipes > volume)
  37.             {
  38.                 double volumeOut = (volumePipes- volume);
  39.                 Console.WriteLine("For " + hours + " hours the pool overflows with " +
  40.                     (volumeOut) + " liters.");
  41.             }
  42.         }
  43.  
  44.     }
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top