title: Sum Series 0 6 0 06 0 006 0 0006 N Terms
signature: fun sumSeries06006000600006NTerms(n: Int): Double {
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 ) );
  }
question_info.test_list: [{"idx": 0, "outputs": 0.5994, "inputs": {"n": 1}}, {"idx": 1, "outputs": 0.65934, "inputs": {"n": 2}}, {"idx": 2, "outputs": 0.665334, "inputs": {"n": 3}}, {"idx": 3, "outputs": 0.6659334, "inputs": {"n": 4}}, {"idx": 4, "outputs": 0.6659933400000001, "inputs": {"n": 5}}, {"idx": 5, "outputs": 0.666, "inputs": {"n": 74}}, {"idx": 6, "outputs": 0.666, "inputs": {"n": 77}}, {"idx": 7, "outputs": 0.666, "inputs": {"n": 67}}, {"idx": 8, "outputs": 0.665999999334, "inputs": {"n": 9}}, {"idx": 9, "outputs": 0.665999999999334, "inputs": {"n": 12}}]
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(n: Int, expected:Double):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(1, 0.5994)
      println("TEST-0...${result}")
      
      result = driver(2, 0.65934)
      println("TEST-1...${result}")
      
      result = driver(3, 0.665334)
      println("TEST-2...${result}")
      
      result = driver(4, 0.6659334)
      println("TEST-3...${result}")
      
      result = driver(5, 0.6659933400000001)
      println("TEST-4...${result}")
      
      result = driver(74, 0.666)
      println("TEST-5...${result}")
      
      result = driver(77, 0.666)
      println("TEST-6...${result}")
      
      result = driver(67, 0.666)
      println("TEST-7...${result}")
      
      result = driver(9, 0.665999999334)
      println("TEST-8...${result}")
      
      result = driver(12, 0.665999999999334)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: sumSeries06006000600006NTerms
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