title: Program Octal Decimal Conversion
signature: fun programOctalDecimalConversion(n: Int): Int {
source_py: def program_octal_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 * 8)
      return dec_value
source_cpp: int program_octal_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 * 8;
    }
    return dec_value;
  }
question_info.test_list: [{"idx": 0, "outputs": 31, "inputs": {"n": 37}}, {"idx": 1, "outputs": 21, "inputs": {"n": 25}}, {"idx": 2, "outputs": 51, "inputs": {"n": 63}}, {"idx": 3, "outputs": 54, "inputs": {"n": 66}}, {"idx": 4, "outputs": 26, "inputs": {"n": 32}}, {"idx": 5, "outputs": 5, "inputs": {"n": 5}}, {"idx": 6, "outputs": 33, "inputs": {"n": 41}}, {"idx": 7, "outputs": 66, "inputs": {"n": 82}}, {"idx": 8, "outputs": 44, "inputs": {"n": 54}}, {"idx": 9, "outputs": 5, "inputs": {"n": 5}}]
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: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(37, 31)
      println("TEST-0...${result}")
      
      result = driver(25, 21)
      println("TEST-1...${result}")
      
      result = driver(63, 51)
      println("TEST-2...${result}")
      
      result = driver(66, 54)
      println("TEST-3...${result}")
      
      result = driver(32, 26)
      println("TEST-4...${result}")
      
      result = driver(5, 5)
      println("TEST-5...${result}")
      
      result = driver(41, 33)
      println("TEST-6...${result}")
      
      result = driver(82, 66)
      println("TEST-7...${result}")
      
      result = driver(54, 44)
      println("TEST-8...${result}")
      
      result = driver(5, 5)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: programOctalDecimalConversion
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