Advertisement
grach

2017_18_March_Dog House

Jul 20th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 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 DogHouse
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double LenghtA = double.Parse(Console.ReadLine());
  14.             double HighB = double.Parse(Console.ReadLine());
  15.  
  16.             double bothSide = LenghtA * (LenghtA / 2) * 2;
  17.             double backSide =
  18.                 /*square*/    ((LenghtA / 2) * (LenghtA / 2)) +
  19.                 /* triangle*/ (LenghtA / 2) * (HighB - (LenghtA / 2)) / 2.00;
  20.             //double Entrance = (LenghtA/(HighB/2.0))* (LenghtA / (HighB / 2.0));
  21.             double Entrance = (LenghtA / 5.0) * (LenghtA / 5.0);
  22.             double frontWall = backSide - Entrance;
  23.             double totalWallArea = bothSide + backSide + frontWall;
  24.  
  25.             //double greenPaint = totalWallArea/ (LenghtA / 2.0);
  26.             double greenPaint = totalWallArea / 3.0;
  27.  
  28.             double theRoof = LenghtA * (LenghtA / 2) * 2;
  29.  
  30.             //double redPaint = theRoof / (HighB / 2.0);
  31.             double redPaint = theRoof / 5;
  32.  
  33.  
  34.             Console.WriteLine("{0:f2}", greenPaint);
  35.             Console.WriteLine("{0:f2}", redPaint);
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement