silvana1303

house painting

Mar 23rd, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace silvanadoc
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.            
  10.  
  11.             double height = double.Parse(Console.ReadLine());
  12.             double lenght = double.Parse(Console.ReadLine());
  13.             double triangleHeight = double.Parse(Console.ReadLine());
  14.  
  15.             double frontWall = (height * height) * 2 - 1.2 * 2;
  16.             double sideWalls = (height * lenght) * 2 - ((1.5 * 1.5) * 2);
  17.            
  18.  
  19.             double greenPaint = (frontWall + sideWalls) / 3.4;
  20.  
  21.             double roof = 2*(height * lenght);
  22.             double roofTriangle = 2 * (height * triangleHeight / 2);
  23.  
  24.             double redPaint = (roof + roofTriangle) / 4.3;
  25.  
  26.             Console.WriteLine($"{greenPaint:f2}");
  27.             Console.WriteLine($"{redPaint:f2}");
  28.  
  29.  
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment