Advertisement
Niicksana

Grandpa Stavri

Dec 9th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _4.Grandpa_Stavri
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             // Exam - 17 September 2017
  14.             int days = int.Parse(Console.ReadLine());
  15.  
  16.             double totalLiters = 0;
  17.             double Degrees = 0;
  18.  
  19.             for (int row = 1; row <= days; row++)
  20.             {
  21.                 double liters = double.Parse(Console.ReadLine());
  22.                 double degrees = double.Parse(Console.ReadLine());
  23.  
  24.                 totalLiters += liters;
  25.                 Degrees += liters * degrees;
  26.             }
  27.  
  28.             double totalDegree = Degrees / totalLiters;
  29.             Console.WriteLine("Liter: {0:f2}", totalLiters);
  30.             Console.WriteLine("Degrees: {0:f2}", totalDegree);
  31.  
  32.             if (totalDegree < 38)
  33.             {
  34.                 Console.WriteLine("Not good, you should baking!");
  35.             }
  36.  
  37.             else if (totalDegree >= 38 && totalDegree <= 42)
  38.             {
  39.                 Console.WriteLine("Super!");
  40.             }
  41.  
  42.             else
  43.             {
  44.                 Console.WriteLine("Dilution with distilled water!");
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement