title: Program Calculate Volume Octahedron
signature: function program_calculate_volume_octahedron(side)
source_py: def program_calculate_volume_octahedron(side):
      return (((side * side) * side) * (math.sqrt(2) / 3))
source_cpp: double program_calculate_volume_octahedron(double side) {
    return ( ( side * side * side ) * ( sqrt ( 2 ) / 3 ) );
  }
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(3355.322051344013, 17807230335.375374)
      print(string.format("TEST-0...%s",result))
  
      result = driver(-891.0551553192736, -333508958.9649689)
      print(string.format("TEST-1...%s",result))
  
      result = driver(8242.699647177868, 263998930936.71603)
      print(string.format("TEST-2...%s",result))
  
      result = driver(-9259.146104439229, -374202387762.81836)
      print(string.format("TEST-3...%s",result))
  
      result = driver(7712.806145993083, 216287285897.3415)
      print(string.format("TEST-4...%s",result))
  
      result = driver(-4998.858862079315, -58885228987.99368)
      print(string.format("TEST-5...%s",result))
  
      result = driver(9771.127582524628, 439772223071.1617)
      print(string.format("TEST-6...%s",result))
  
      result = driver(-5415.8106399098115, -74883158892.28471)
      print(string.format("TEST-7...%s",result))
  
      result = driver(670.0774772280249, 141830229.25431916)
      print(string.format("TEST-8...%s",result))
  
      result = driver(-7068.634369272122, -166494655500.3635)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 17807230335.375374, "inputs": {"side": 3355.322051344013}}, {"idx": 1, "outputs": -333508958.9649689, "inputs": {"side": -891.0551553192736}}, {"idx": 2, "outputs": 263998930936.71603, "inputs": {"side": 8242.699647177868}}, {"idx": 3, "outputs": -374202387762.81836, "inputs": {"side": -9259.146104439229}}, {"idx": 4, "outputs": 216287285897.3415, "inputs": {"side": 7712.806145993083}}, {"idx": 5, "outputs": -58885228987.99368, "inputs": {"side": -4998.858862079315}}, {"idx": 6, "outputs": 439772223071.1617, "inputs": {"side": 9771.127582524628}}, {"idx": 7, "outputs": -74883158892.28471, "inputs": {"side": -5415.8106399098115}}, {"idx": 8, "outputs": 141830229.25431916, "inputs": {"side": 670.0774772280249}}, {"idx": 9, "outputs": -166494655500.3635, "inputs": {"side": -7068.634369272122}}]
question_info.extension: lua
question_info.entry_fn_name: program_calculate_volume_octahedron
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__