title: Program Print Sum Given Nth Term 1
signature: function programPrintSumGivenNthTerm1(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return Math.abs(actual - expected) < 1e-06;
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(42, 1764.0);
    console.log(`TEST-0...${result}`);
  
    result = driver(40, 1600.0);
    console.log(`TEST-1...${result}`);
  
    result = driver(67, 4489.0);
    console.log(`TEST-2...${result}`);
  
    result = driver(73, 5329.0);
    console.log(`TEST-3...${result}`);
  
    result = driver(18, 324.0);
    console.log(`TEST-4...${result}`);
  
    result = driver(16, 256.0);
    console.log(`TEST-5...${result}`);
  
    result = driver(74, 5476.0);
    console.log(`TEST-6...${result}`);
  
    result = driver(33, 1089.0);
    console.log(`TEST-7...${result}`);
  
    result = driver(92, 8464.0);
    console.log(`TEST-8...${result}`);
  
    result = driver(22, 484.0);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
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 );
  }