title: Program Octal Decimal Conversion
signature: programOctalDecimalConversion :: Integer -> Integer
  programOctalDecimalConversion n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (37) (31) )
  
      printf "TEST-1...%s\n" (driver (25) (21) )
  
      printf "TEST-2...%s\n" (driver (63) (51) )
  
      printf "TEST-3...%s\n" (driver (66) (54) )
  
      printf "TEST-4...%s\n" (driver (32) (26) )
  
      printf "TEST-5...%s\n" (driver (5) (5) )
  
      printf "TEST-6...%s\n" (driver (41) (33) )
  
      printf "TEST-7...%s\n" (driver (82) (66) )
  
      printf "TEST-8...%s\n" (driver (54) (44) )
  
      printf "TEST-9...%s\n" (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;
  }