#include <iostream>
#include <cmath>
double surfaceAreaOfPyramid(double sideLength, double height) {
double surfaceArea = (sideLength * sideLength) + 2 *
(sideLength * std::sqrt(std::pow(height, 2) +
std::pow((sideLength / 2), 2)));
return surfaceArea;
}
int main() {
double sideLength = 8.0;
double height = 14.0;
std::cout << surfaceAreaOfPyramid(sideLength, height) << std::endl;
}
/*
run:
296.964
*/