test_case_2 = A1.subtract(14, 2) student_answers.append(test_case_2) test_case_3 = A1.multiply(10, 8) student_answers.append(test_case_3) test_case_4 = A1.divide(10, 2) student_answers.append(test_case_4) test_case_5 = A1.power(2, 4) student_answers.append(test_case_5) test_case_6 = A1.printGP(2, 3, 4) student_answers.append(test_case_6) test_case_7 = A1.printAP(2, 3, 4) student_answers.append(test_case_7) test_case_8 = A1.printHP(2, 3, 3) student_answers.append(test_case_8) print(actual_answers) print(student_answers) total_test_cases = len(actual_answers) count_of_correct_test_cases = 0 for x, y in zip(actual_answers, student_answers): if x == y: count_of_correct_test_cases += 1
gp1 = list(gp1) student_answers.append(gp1) a = -2 r = 1.5 n = 5.0 #float number of n gives result 0 gp2 = A1.printGP(a,r,n) gp2 = list(gp2) student_answers.append(gp2) #for ap a = -2 d = 1.5 n = 5 ap1 = A1.printAP(a,d,n) ap1 = list(ap1) student_answers.append(ap1) a = -2 d = 1.5 n = 5.0 #float number of n gives result 0 ap2 = A1.printAP(a,d,n) ap2 = list(ap2) student_answers.append(ap2) #for hp a = -2 d = 1.5 n = 5.0
student_answers.append(test_case_4) # Driver code a = 2 # starting number r = 3 # Common ratio n = 5 # N th term to be find gp = A1.printGP(a, r, n) gp = list(gp) student_answers.append(gp) power = A1.power(8.8, -3) student_answers.append(power) ap = A1.printAP(6, -1, 6) student_answers.append(ap) # print(gp) print(actual_answers) print(student_answers) total_test_cases = len(actual_answers) count_of_correct_test_cases = 0 for x, y in zip(actual_answers, student_answers): if x == y: count_of_correct_test_cases += 1 print( f"Test Cases Passed = '{count_of_correct_test_cases}' / '{total_test_cases}'"
test_case_3 = A1.multiply(10, 8) student_answers.append(test_case_3) test_case_4 = A1.divide(10, 2) student_answers.append(test_case_4) test_case_5 = A1.power(10, -2) student_answers.append(test_case_5) test_case_6 = A1.power(2, 10) student_answers.append(test_case_6) # Driver code ap = A1.printAP(2, -6, 4) ap = list(ap) student_answers.append(ap) gp = A1.printGP(6, 0.5, 5) gp = list(gp) student_answers.append(gp) hp = A1.printHP(1, 1, 4) hp = list(hp) student_answers.append(hp) print(ap) print(gp) print(hp) print(actual_answers)
test_case_6 = A1.power(10, 2.08) # invalid as num2 is not integer student_answers.append(test_case_6) test_case_7 = A1.power(10, -1) student_answers.append(test_case_7) gp = A1.printGP(2, 3, 4) gp = list(gp) student_answers.append(gp) gp = A1.printGP(2, 3, 4.001) # invalid as n is floating gp = list(gp) student_answers.append(gp) ap = A1.printAP(2, 3, 4) ap = list(ap) student_answers.append(ap) ap = A1.printAP(2, 3, 4.009) # invalid ap = list(ap) student_answers.append(ap) hp = A1.printHP(4, 2, 4) hp = list(hp) student_answers.append(hp) hp = A1.printHP(4, -1, 5) # invalid 1/0 form hp = list(hp) student_answers.append(hp)
student_answers.append(test_case_2) test_case_3 = A1.multiply(10, 8) student_answers.append(test_case_3) test_case_4 = A1.divide(10, 2) student_answers.append(test_case_4) test_case_5 = A1.power(3, -1) student_answers.append(test_case_5) gp = A1.printGP(2, 3, 5) gp = list(gp) student_answers.append(gp) ap = A1.printAP(2, 4, 5) ap = list(ap) student_answers.append(ap) hp = A1.printHP(1, 1, 5) hp = list(hp) student_answers.append(hp) print(actual_answers) print(student_answers) total_test_cases = len(actual_answers) count_of_correct_test_cases = 0 for x, y in zip(actual_answers, student_answers): if x == y:
# Code for test case checking of GP a = 10.2 r = 2 n = 5.0 test_case_6 =A1.printGP(a,r,n) student_answers.append(list(test_case_6)) # Code for test case checking of AP a = 10 d = 2 n = 7.0 test_case_7 =A1.printAP(a,r,n) student_answers.append(list(test_case_7)) # Code for test case checking of HP a = 10 d = 2 n = 7 test_case_7 =A1.printHP(a,r,n) student_answers.append(list(test_case_7)) print(actual_answers) print(student_answers)