title: Program For Surface Area Of Octahedron
signature: function program_for_surface_area_of_octahedron(side)
source_py: def program_for_surface_area_of_octahedron(side):
      return ((2 * math.sqrt(3)) * (side * side))
source_cpp: double program_for_surface_area_of_octahedron(double side) {
    return ( 2 * ( sqrt ( 3 ) ) * ( side * side ) );
  }
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return math.abs(actual - expected) < 1e-09
  end
  
  function driver(side, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(side) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(1449.255716877097, 7275798.574924052)
      print(string.format("TEST-0...%s",result))
  
      result = driver(-8772.104874265995, 266562009.34357828)
      print(string.format("TEST-1...%s",result))
  
      result = driver(2948.419328234334, 30114046.875937637)
      print(string.format("TEST-2...%s",result))
  
      result = driver(-1184.220109553511, 4857977.358664159)
      print(string.format("TEST-3...%s",result))
  
      result = driver(7422.825800698956, 190866258.51879707)
      print(string.format("TEST-4...%s",result))
  
      result = driver(-5808.280006171851, 116865336.10679008)
      print(string.format("TEST-5...%s",result))
  
      result = driver(829.8963781665169, 2385823.7719733207)
      print(string.format("TEST-6...%s",result))
  
      result = driver(-7368.438572511732, 188079541.63799432)
      print(string.format("TEST-7...%s",result))
  
      result = driver(5572.033890611617, 107551908.5552799)
      print(string.format("TEST-8...%s",result))
  
      result = driver(-3998.9441642787706, 55396369.52612884)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 7275798.574924052, "inputs": {"side": 1449.255716877097}}, {"idx": 1, "outputs": 266562009.34357828, "inputs": {"side": -8772.104874265995}}, {"idx": 2, "outputs": 30114046.875937637, "inputs": {"side": 2948.419328234334}}, {"idx": 3, "outputs": 4857977.358664159, "inputs": {"side": -1184.220109553511}}, {"idx": 4, "outputs": 190866258.51879707, "inputs": {"side": 7422.825800698956}}, {"idx": 5, "outputs": 116865336.10679008, "inputs": {"side": -5808.280006171851}}, {"idx": 6, "outputs": 2385823.7719733207, "inputs": {"side": 829.8963781665169}}, {"idx": 7, "outputs": 188079541.63799432, "inputs": {"side": -7368.438572511732}}, {"idx": 8, "outputs": 107551908.5552799, "inputs": {"side": 5572.033890611617}}, {"idx": 9, "outputs": 55396369.52612884, "inputs": {"side": -3998.9441642787706}}]
question_info.extension: lua
question_info.entry_fn_name: program_for_surface_area_of_octahedron
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__