title: Program Print Sum Given Nth Term 1
signature: func programPrintSumGivenNthTerm1(n int) float64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual float64, expected float64) bool {
      return math.Abs(actual - expected) < 1e-06
  }
  
  func driver(n int, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(42, 1764.0)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(40, 1600.0)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(67, 4489.0)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(73, 5329.0)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(18, 324.0)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(16, 256.0)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(74, 5476.0)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(33, 1089.0)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(92, 8464.0)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(22, 484.0)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def program_print_sum_given_nth_term_1(n):
      return math.pow(n, 2)
source_cpp: int program_print_sum_given_nth_term_1(long n) {
    return pow ( n, 2 );
  }