Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Conditional_Statements___More_Exercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- double V = double.Parse(Console.ReadLine());
- double P1 = double.Parse(Console.ReadLine());
- double P2 = double.Parse(Console.ReadLine());
- double H = double.Parse(Console.ReadLine());
- double totalV = (H * P1) + (H * P2);
- if (totalV <= V)
- {
- double P1Debit = P1 * H / totalV * 100; //P1debit - totalH
- double P2Debit = P2 * H / totalV * 100;
- Console.WriteLine($"The pool is {totalV * 0.1:F2}% full. Pipe 1: {P1Debit:F2}%." +
- $"Pipe 2: {P2Debit:F2}%.");
- }
- else
- {
- Console.WriteLine($"For {H} hours the pool overflows with {(totalV - V):F2} liters.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement