title: Program Calculate Area Octagon
signature: double programCalculateAreaOctagon(double side) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(double actual, double expected){
      return abs(actual - expected) < 1e-09;
  }
  
  string driver(double side, double expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(side), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver(5859.798616323926, 165794860.15449765); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(-6381.210375893524, 196612808.27272156); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(2442.246292006922, 28799476.852711495); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver(-9624.81536339737, 447291345.3087225); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver(8679.436805247444, 363738081.5089271); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver(-2682.3245401089525, 34739881.027797274); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver(7216.9161613024435, 251483213.5426547); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver(-5881.789859815442, 167041618.6125096); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver(2497.776395789202, 30124010.84898392); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver(-9598.912195459263, 444887003.7391194); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def program_calculate_area_octagon(side):
      return (((2 * (1 + math.sqrt(2))) * side) * side)
source_cpp: double program_calculate_area_octagon(double side) {
    return ( float ) ( 2 * ( 1 + sqrt ( 2 ) ) * side * side );
  }