Aliendreamer

house paint

Mar 18th, 2017
611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 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 issue1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //input
  14.  
  15.             double lenghtA = double.Parse(Console.ReadLine());
  16.             double HeightB =double.Parse(Console.ReadLine());
  17.  
  18.  
  19.            double onesidebody = lenghtA * (lenghtA / 2);
  20.             double backsidesqyare =(lenghtA/2)*(lenghtA / 2);
  21.            double backsidetriangle = (lenghtA / 2) *( HeightB - (lenghtA / 2));
  22.             double backsidetrianglee = backsidetriangle / 2;
  23.             double backside = backsidesqyare + backsidetrianglee;
  24.             double door =(lenghtA/5)*( lenghtA / 5);
  25.             double frontside = (backsidetrianglee + backsidesqyare) - door;
  26.             double roofoneside = lenghtA * (lenghtA / 2);
  27.             double roof = 2 * roofoneside;
  28.             double house = backside + frontside + (2 * onesidebody);
  29.  
  30.             double greenPaint = house / 3;
  31.             double redpaint = roof / 5;
  32.  
  33.             Console.WriteLine("{0:f2}",greenPaint);
  34.             Console.WriteLine("{0:f2}",redpaint);
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment