title: Program Calculate Area Octagon
signature: fun programCalculateAreaOctagon(side: Double): Double {
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.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Double, expected:Double):Boolean{
    return abs(actual - expected) < 1e-09
  }
  fun driver(side: Double, expected:Double):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(side), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(5859.798616323926, 165794860.15449765)
      println("TEST-0...${result}")
      
      result = driver(-6381.210375893524, 196612808.27272156)
      println("TEST-1...${result}")
      
      result = driver(2442.246292006922, 28799476.852711495)
      println("TEST-2...${result}")
      
      result = driver(-9624.81536339737, 447291345.3087225)
      println("TEST-3...${result}")
      
      result = driver(8679.436805247444, 363738081.5089271)
      println("TEST-4...${result}")
      
      result = driver(-2682.3245401089525, 34739881.027797274)
      println("TEST-5...${result}")
      
      result = driver(7216.9161613024435, 251483213.5426547)
      println("TEST-6...${result}")
      
      result = driver(-5881.789859815442, 167041618.6125096)
      println("TEST-7...${result}")
      
      result = driver(2497.776395789202, 30124010.84898392)
      println("TEST-8...${result}")
      
      result = driver(-9598.912195459263, 444887003.7391194)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: programCalculateAreaOctagon
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn