title: Program Print Sum Given Nth Term 1
signature: fun programPrintSumGivenNthTerm1(n: Int): Float {
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.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.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Float, expected:Float):Boolean{
    return abs(actual - expected) < 1e-06f
  }
  fun driver(n: Int, expected:Float):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(42, 1764.0f)
      println("TEST-0...${result}")
      
      result = driver(40, 1600.0f)
      println("TEST-1...${result}")
      
      result = driver(67, 4489.0f)
      println("TEST-2...${result}")
      
      result = driver(73, 5329.0f)
      println("TEST-3...${result}")
      
      result = driver(18, 324.0f)
      println("TEST-4...${result}")
      
      result = driver(16, 256.0f)
      println("TEST-5...${result}")
      
      result = driver(74, 5476.0f)
      println("TEST-6...${result}")
      
      result = driver(33, 1089.0f)
      println("TEST-7...${result}")
      
      result = driver(92, 8464.0f)
      println("TEST-8...${result}")
      
      result = driver(22, 484.0f)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: programPrintSumGivenNthTerm1
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn