pupesko

SoftUni - 5.9 Trapezoids

Oct 11th, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. //Write an expression that calculates trapezoid's area by given sides a and b and height h.
  2.  
  3. using System;
  4.  
  5. class Trapezoids
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Enetr a: ");
  10.         double a = double.Parse(Console.ReadLine());
  11.  
  12.         Console.Write("Enetr b: ");
  13.         double b = double.Parse(Console.ReadLine());
  14.  
  15.         Console.Write("Enetr h: ");
  16.         double h = double.Parse(Console.ReadLine());
  17.  
  18.         Console.WriteLine("Area = {0}", ((a + b) * h) / 2);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment