title: Program Print Sum Given Nth Term
signature: def programPrintSumGivenNthTerm(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(
        39, 
        1521    
      )}")   
  
  
      println(s"TEST-1...${driver(
        20, 
        400    
      )}")   
  
  
      println(s"TEST-2...${driver(
        10, 
        100    
      )}")   
  
  
      println(s"TEST-3...${driver(
        39, 
        1521    
      )}")   
  
  
      println(s"TEST-4...${driver(
        70, 
        4900    
      )}")   
  
  
      println(s"TEST-5...${driver(
        21, 
        441    
      )}")   
  
  
      println(s"TEST-6...${driver(
        21, 
        441    
      )}")   
  
  
      println(s"TEST-7...${driver(
        80, 
        6400    
      )}")   
  
  
      println(s"TEST-8...${driver(
        89, 
        7921    
      )}")   
  
  
      println(s"TEST-9...${driver(
        99, 
        9801    
      )}")   
  
  }
  
source_py: def program_print_sum_given_nth_term(n):
      S = 0
      for i in range(1, (n + 1)):
          S += ((i * i) - ((i - 1) * (i - 1)))
      return S
source_cpp: int program_print_sum_given_nth_term(long n) {
    int S = 0;
    for ( int i = 1;
    i <= n;
    i ++ ) S += i * i - ( i - 1 ) * ( i - 1 );
    return S;
  }