title: Sum Series 0 6 0 06 0 006 0 0006 N Terms
signature: function sum_series_0_6_0_06_0_006_0_0006_n_terms(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return abs(actual - expected) < 1e-09
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(1, 0.5994);
      @printf("TEST-0...%s\n",result);
      
      result = driver(2, 0.65934);
      @printf("TEST-1...%s\n",result);
      
      result = driver(3, 0.665334);
      @printf("TEST-2...%s\n",result);
      
      result = driver(4, 0.6659334);
      @printf("TEST-3...%s\n",result);
      
      result = driver(5, 0.6659933400000001);
      @printf("TEST-4...%s\n",result);
      
      result = driver(74, 0.666);
      @printf("TEST-5...%s\n",result);
      
      result = driver(77, 0.666);
      @printf("TEST-6...%s\n",result);
      
      result = driver(67, 0.666);
      @printf("TEST-7...%s\n",result);
      
      result = driver(9, 0.665999999334);
      @printf("TEST-8...%s\n",result);
      
      result = driver(12, 0.665999999999334);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def sum_series_0_6_0_06_0_006_0_0006_n_terms(n):
      return (0.666 * (1 - (1 / pow(10, n))))
source_cpp: float sum_series_0_6_0_06_0_006_0_0006_n_terms(int n) {
    return ( 0.666 ) * ( 1 - 1 / pow ( 10, n ) );
  }