title: Program Print Sum Given Nth Term 1
signature: class Solution {
  
      public Float programPrintSumGivenNthTerm1(Integer n) {
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 );
  }
question_info.extension: java
question_info.entry_fn_name: programPrintSumGivenNthTerm1
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 1764.0, "inputs": {"n": 42}}, {"idx": 1, "outputs": 1600.0, "inputs": {"n": 40}}, {"idx": 2, "outputs": 4489.0, "inputs": {"n": 67}}, {"idx": 3, "outputs": 5329.0, "inputs": {"n": 73}}, {"idx": 4, "outputs": 324.0, "inputs": {"n": 18}}, {"idx": 5, "outputs": 256.0, "inputs": {"n": 16}}, {"idx": 6, "outputs": 5476.0, "inputs": {"n": 74}}, {"idx": 7, "outputs": 1089.0, "inputs": {"n": 33}}, {"idx": 8, "outputs": 8464.0, "inputs": {"n": 92}}, {"idx": 9, "outputs": 484.0, "inputs": {"n": 22}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Float expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(42, 1764.0f);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(40, 1600.0f);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(67, 4489.0f);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(73, 5329.0f);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(18, 324.0f);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(16, 256.0f);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(74, 5476.0f);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(33, 1089.0f);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(92, 8464.0f);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(22, 484.0f);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Float expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Float actual, Float expected){
          return Math.abs(actual - expected) < 1e-06f;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__