title: Program Octal Decimal Conversion
signature: program_octal_decimal_conversion <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          37L, 
          31L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          25L, 
          21L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          63L, 
          51L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          66L, 
          54L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          32L, 
          26L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          5L, 
          5L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          41L, 
          33L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          82L, 
          66L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          54L, 
          44L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          5L, 
          5L
      )))
  
  }
  
  main()
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;
  }