title: Program Calculate Area Octagon
signature: function programCalculateAreaOctagon(side: number): number {
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 );
  }
question_info.test_list: [{"idx": 0, "outputs": 165794860.15449765, "inputs": {"side": 5859.798616323926}}, {"idx": 1, "outputs": 196612808.27272156, "inputs": {"side": -6381.210375893524}}, {"idx": 2, "outputs": 28799476.852711495, "inputs": {"side": 2442.246292006922}}, {"idx": 3, "outputs": 447291345.3087225, "inputs": {"side": -9624.81536339737}}, {"idx": 4, "outputs": 363738081.5089271, "inputs": {"side": 8679.436805247444}}, {"idx": 5, "outputs": 34739881.027797274, "inputs": {"side": -2682.3245401089525}}, {"idx": 6, "outputs": 251483213.5426547, "inputs": {"side": 7216.9161613024435}}, {"idx": 7, "outputs": 167041618.6125096, "inputs": {"side": -5881.789859815442}}, {"idx": 8, "outputs": 30124010.84898392, "inputs": {"side": 2497.776395789202}}, {"idx": 9, "outputs": 444887003.7391194, "inputs": {"side": -9598.912195459263}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return Math.abs(actual - expected) < 1e-09;
  }
  
  function driver(side: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(side),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(5859.798616323926, 165794860.15449765);
    console.log(`TEST-0...${result}`);
  
    result = driver(-6381.210375893524, 196612808.27272156);
    console.log(`TEST-1...${result}`);
  
    result = driver(2442.246292006922, 28799476.852711495);
    console.log(`TEST-2...${result}`);
  
    result = driver(-9624.81536339737, 447291345.3087225);
    console.log(`TEST-3...${result}`);
  
    result = driver(8679.436805247444, 363738081.5089271);
    console.log(`TEST-4...${result}`);
  
    result = driver(-2682.3245401089525, 34739881.027797274);
    console.log(`TEST-5...${result}`);
  
    result = driver(7216.9161613024435, 251483213.5426547);
    console.log(`TEST-6...${result}`);
  
    result = driver(-5881.789859815442, 167041618.6125096);
    console.log(`TEST-7...${result}`);
  
    result = driver(2497.776395789202, 30124010.84898392);
    console.log(`TEST-8...${result}`);
  
    result = driver(-9598.912195459263, 444887003.7391194);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: programCalculateAreaOctagon
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js