title: Program Binary Decimal Conversion
signature: fun programBinaryDecimalConversion(n: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Int):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(70, 14)
      println("TEST-0...${result}")
      
      result = driver(95, 23)
      println("TEST-1...${result}")
      
      result = driver(41, 9)
      println("TEST-2...${result}")
      
      result = driver(97, 25)
      println("TEST-3...${result}")
      
      result = driver(8, 8)
      println("TEST-4...${result}")
      
      result = driver(16, 8)
      println("TEST-5...${result}")
      
      result = driver(41, 9)
      println("TEST-6...${result}")
      
      result = driver(57, 17)
      println("TEST-7...${result}")
      
      result = driver(81, 17)
      println("TEST-8...${result}")
      
      result = driver(78, 22)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def program_binary_decimal_conversion(n):
      num = n
      dec_value = 0
      base = 1
      temp = num
      while temp:
          last_digit = (temp % 10)
          temp = int((temp / 10))
          dec_value += (last_digit * base)
          base = (base * 2)
      return dec_value
source_cpp: int program_binary_decimal_conversion(int n) {
    int num = n;
    int dec_value = 0;
    int base = 1;
    int temp = num;
    while ( temp ) {
      int last_digit = temp % 10;
      temp = temp / 10;
      dec_value += last_digit * base;
      base = base * 2;
    }
    return dec_value;
  }