title: Program Octal Decimal Conversion
signature: def programOctalDecimalConversion(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        37, 
        31    
      )}")   
  
  
      println(s"TEST-1...${driver(
        25, 
        21    
      )}")   
  
  
      println(s"TEST-2...${driver(
        63, 
        51    
      )}")   
  
  
      println(s"TEST-3...${driver(
        66, 
        54    
      )}")   
  
  
      println(s"TEST-4...${driver(
        32, 
        26    
      )}")   
  
  
      println(s"TEST-5...${driver(
        5, 
        5    
      )}")   
  
  
      println(s"TEST-6...${driver(
        41, 
        33    
      )}")   
  
  
      println(s"TEST-7...${driver(
        82, 
        66    
      )}")   
  
  
      println(s"TEST-8...${driver(
        54, 
        44    
      )}")   
  
  
      println(s"TEST-9...${driver(
        5, 
        5    
      )}")   
  
  }
  
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;
  }