test_case_6 = A1.add(-4,5)
student_answers.append(test_case_6)

test_case_7 = A1.multiply(-4.7, 54)
student_answers.append(test_case_7)



################################################################################################

# power

num1 = -2.5
num2 = 7
result = A1.power(num1,num2)
student_answers.append(result)

num1 = -2.5
num2 = -7
result = A1.power(num1,num2)
student_answers.append(result)

# for gp 

a = -2
r = 1.5
n = 5
gp1 = A1.printGP(a,r,n)
gp1 = list(gp1)
student_answers.append(gp1)
student_answers.append(test_case_3)

test_case_4 = A1.divide(10, 2)
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
]
student_answers = []

test_case_1 = A1.add(4, 5)
student_answers.append(test_case_1)

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)
print(gp)
print(actual_answers)
print(student_answers)

a=5
d=-1
n=10
hp= A1.printHP(a,d,n)
hp=list(hp)
student_answers.append(hp)

print(hp)
print(actual_answers)
print(student_answers)

num1='a'
num2=0
power=A1.power(num1,num2)
student_answers.append(power)

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}'")

Ejemplo n.º 5
0
]
student_answers = []

test_case_1 = A1.add(4, 5)
student_answers.append(test_case_1)

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(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)
]
student_answers = []

test_case_1 = A1.add(4, 5)
student_answers.append(test_case_1)

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(1.1, 2)
student_answers.append(test_case_5)

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)
Ejemplo n.º 7
0
]
student_answers = []

test_case_1 = A1.add(4, 5)
student_answers.append(test_case_1)

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(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)
Ejemplo n.º 8
0
student_answers = []

test_case_1 = A1.add(4, 5)
student_answers.append(test_case_1)

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(-5, 10)
student_answers.append(test_case_5)

# 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