✍️ Practice Lab 1
Write a C# program that estimates the floor area of Brittain Hall (BH).
Approximate each floor of BH as a trapezoid with bases and plus a triangle with base , where both shapes have height (the hallway width).

With floors, the total area is:
Your program must print the estimated area of Brittain Hall.
👀Hint
Pseudocode:
- Store each measurement in its own variable (
numFloors,base1,base2,base3,width) asdouble - Break the formula into small steps: compute the trapezoid area, then the triangle area, then the area of one floor, and finally multiply by the number of floors.
- Use
Console.WriteLineto print your answer.
💡Solution
using System;
double numFloors = 4;
double base1 = 18; // in meters
double base2 = 20; // in meters
double base3 = 3; // in meters
double width = 15; // in meters
double trapezoid = width * (base1 + base2) / 2;
double triangle = width * base3 / 2;
double areaOneFloor = trapezoid + triangle;
double areaBH = numFloors * areaOneFloor;
Console.WriteLine("The estimated area of Brittain Hall is: " + areaBH);
Output:
The estimated area of Brittain Hall is: 1230