Hi, Was wondering if someone can make a short and quick pseudocode for this peice of code. Thanks
Dont need editing or anything just pseudocode. Ill hit you up with a vouch aswel
Code:
#over here i am going to start writing a code, that tests a child on 10 questions, and then gives a total scrore out of 10.
import random
print("Please enter your name")
name = input()
from random import randint
correct = 0
a1 = randint(1,20)
a2 = randint(1,20)
answer = str(a1 + a2)
question = input(" 1) what is " + str(a1) + " + " + str(a2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Awe snap! That was wrong :( correct answer is: ",answer)
b1 = randint(1,10)
b2 = randint(1,10)
answer = str(b1 + b2)
question = input("2) what is " + str(b1) + " + " + str(b2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
c1 = randint(1,30)
c2 = randint(1,30)
answer = str(c1 - c2)
question = input("3) what is " + str(c1) + " - " + str(c2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
d1= randint(1,100)
d2 = randint(1,100)
answer = str(d1 * d2)
question = input("4) what is " + str(d1) + " * " + str(d2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
e1 = randint(1,10)
e2 = randint(1,10)
answer = str(e1 - e2)
question = input("5) what is " + str(e1) + " - " + str(e2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
z1 = randint(1,45)
z2 = randint(1,45)
answer = str(z1 * z2)
question = input("6) what is " + str(z1) + " * " + str(z2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
f1 = randint(1,15)
f2 = randint(1,15)
answer = str(f1 + f2)
question = input("7) what is " + str(f1) + " + " + str(f2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
g1 = randint(1,30)
g2= randint(1,30)
answer = str(g1 - g2)
question = input("8) what is " + str(g1) + " - " + str(g2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
h1 = randint(1,20)
h2 = randint(1,20)
answer = str(h1 - h2)
question = input("9) what is " + str(h1) + " - " + str(h2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
i1 = randint(1,40)
i2 = randint(1,20)
answer = str(i1 - i2)
question = input("10) what is " + str(i1) + " - " + str(i2) + "?")
ans = input()
if ans == answer:
print("nice work keep it up.\n")
correct = correct + 1
else:
print ("Sorry that is incorrect, the answer is",answer)
print("\nYou got",correct, " out of 10.")
if correct == 10:
print("Nice work! keep it up")
elif correct == 9:
print("Nice! Your almost here!")
elif correct == 7:
print ("Keep working!")
elif correct == 6:
print ("Try harder!")
elif correct == 5:
print ("You need to revise more!")
elif correct == 4:
print ("There is space for improvment!")
elif correct == 3:
print ("Try taking tuition!")
elif correct == 2:
print ("you need to work alot harder!")
elif correct == 1:
print ("Keep going, you will get there!")
else:
print ("See me after school!")
Dont need editing or anything just pseudocode. Ill hit you up with a vouch aswel

