Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace AssesmentTravelDayNight
- {
- class AssesmentTravelDayNight
- {
- static void Main(string[] args)
- {
- var poolVolume = int.Parse(Console.ReadLine());
- var pibe1 = int.Parse(Console.ReadLine());
- var pibe2 = int.Parse(Console.ReadLine());
- var hours = double.Parse(Console.ReadLine());
- var pibe1volue = pibe1 * hours;
- var pibe2volue = pibe2 * hours;
- var totalvolue = pibe1volue + pibe2volue;
- if (totalvolue <= poolVolume)
- {
- var percent = totalvolue / poolVolume * 100;
- var pibe1percent = pibe1volue / totalvolue * 100;
- var pibe2percent = pibe2volue / totalvolue * 100;
- Console.WriteLine("The pool is {0}% full. Pipe 1: {1:f0}%. Pipe 2: {2:f0}%.", percent,Math.Floor(pibe1percent), Math.Floor(pibe2percent));
- }
- else if (pibe1 + pibe2 > poolVolume)
- {
- var overfull= Math.Abs(poolVolume - totalvolue);
- Console.WriteLine("For {0} hours the pool overflows with {1:f1} liters.", hours, Math.Round(overfull , 2));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment