title: Sum Series 0 6 0 06 0 006 0 0006 N Terms
signature: function sumSeries06006000600006NTerms($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return abs($actual - $expected) < 1e-09;
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        1, 
        0.5994));
      
      printf("TEST-1...%s\n",driver(
        2, 
        0.65934));
      
      printf("TEST-2...%s\n",driver(
        3, 
        0.665334));
      
      printf("TEST-3...%s\n",driver(
        4, 
        0.6659334));
      
      printf("TEST-4...%s\n",driver(
        5, 
        0.6659933400000001));
      
      printf("TEST-5...%s\n",driver(
        74, 
        0.666));
      
      printf("TEST-6...%s\n",driver(
        77, 
        0.666));
      
      printf("TEST-7...%s\n",driver(
        67, 
        0.666));
      
      printf("TEST-8...%s\n",driver(
        9, 
        0.665999999334));
      
      printf("TEST-9...%s\n",driver(
        12, 
        0.665999999999334));
      
  }
  
  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 ) );
  }