Procedure Login_n_validation
Procedure Simple_Math
Procedure Store_Score
Procedure end_math
Stop
Procedure Login_n_Validatation
Greetings Screen /* Welcome to Basic Math – your Math Assistant*/
Accept User id and Password
Check valid user id and password with user database
If NOT valid user-id
Check database for duplicates
If NOT duplicate
Accept Registration
ELSE
Endif
Endif
End Procedure
Procedure Simple Math
Define Variable operator, variable a, variable b, variable result, actual_result, cntr, score
Get input operator
+: assign operator = +
-: assign operator = -
*: assign operator = *
/: assign operator = /
End case
Set Cntr = 1
Set Score = 0
While cntr <= 10
Variable a = random ()*100, rounded to 0 decimals
Variable b = random ()*100, rounded to 0 decimals
Display: variable a operator variable b
Input result
actual_result = variable a operator variable b
If result == actual_result
Score = Score + 1
End if
Cntr = cntr + 1
End while
End Procedure
Procedure Store_Score
Define Variable high, sec_high, third_high
Get high, sec_high, third_high from score_db
IF score > third_high |and| score < second_high
Third_High = score
Display “Congratulations, you are the third highest scorer!”
Else if score > second_high |and| score < high
Second_high = score
Display “Congratulations, you are the second highest scorer!”
Else
High = score
Display “Congratulations, you are the highest scorer!”
Endif
Write high, second_high, third_high into score_db with user id and date
End Procedure
Procedure end_math
Display “Thank you for using math assistant!”
Display “Press any key to exit program”
Input = null()
Release all variables
End Procedure
Discussion:
The above given pseudo code is the very rudimentary logic that the math assistant needs to follow. Further improvements in terms of GUI and user touch and feel need to be incorporated. There are several objects that can be used from C++ for improving the user experience.