title: Sum Of All Proper Divisors Of A Natural Number
signature: def sumOfAllProperDivisorsOfANaturalNumber(num: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Float , expected: Float): Boolean = {
      (actual - expected).abs < 1e-06F
  }
  
  def driver(num: Int, expected: Float): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        2, 
        1.0F    
      )}")   
  
  
      println(s"TEST-1...${driver(
        57, 
        23.0F    
      )}")   
  
  
      println(s"TEST-2...${driver(
        28, 
        28.0F    
      )}")   
  
  
      println(s"TEST-3...${driver(
        43, 
        1.0F    
      )}")   
  
  
      println(s"TEST-4...${driver(
        38, 
        22.0F    
      )}")   
  
  
      println(s"TEST-5...${driver(
        29, 
        1.0F    
      )}")   
  
  
      println(s"TEST-6...${driver(
        45, 
        33.0F    
      )}")   
  
  
      println(s"TEST-7...${driver(
        47, 
        1.0F    
      )}")   
  
  
      println(s"TEST-8...${driver(
        44, 
        40.0F    
      )}")   
  
  
      println(s"TEST-9...${driver(
        3, 
        1.0F    
      )}")   
  
  }
  
source_py: def sum_of_all_proper_divisors_of_a_natural_number(num):
      result = 0
      i = 2
      while (i <= math.sqrt(num)):
          if ((num % i) == 0):
              if (i == (num / i)):
                  result = (result + i)
              else:
                  result = (result + (i + (num / i)))
          i = (i + 1)
      return (result + 1)
source_cpp: int sum_of_all_proper_divisors_of_a_natural_number(int num) {
    int result = 0;
    for ( int i = 2;
    i <= sqrt ( num );
    i ++ ) {
      if ( num % i == 0 ) {
        if ( i == ( num / i ) ) result += i;
        else result += ( i + num / i );
      }
    }
    return ( result + 1 );
  }