Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- /*
- * Write an expression that calculates trapezoid's area by given sides a and b and height h.
- */
- class TrapezoidArea
- {
- static void Main()
- {
- Console.Write("Please enter the first side\t a = ");
- double sideA = double.Parse(Console.ReadLine());
- Console.Write("\nPlease enter the second side\t b = ");
- double sideB = double.Parse(Console.ReadLine());
- Console.Write("\nPlease enter the trapezoid's height:\t h =");
- double heightH = double.Parse(Console.ReadLine());
- double area = ((sideA + sideB) / 2) * heightH;
- Console.WriteLine("\n\t\tThe area is: {0}\n",area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement