Hi qiangjin2014, I noticed your profile, and am learning C++ and have an interest in ordered linked lists like this. If its ok, I would like to see this project you completed for this assignment so I may better learn from it? Thank you.
The member functions to be defined are:
flash: constructor that creates an empty flash card list.
add_problem: Adds a problem to the end of the list (not to the front). It should prompt the user for the equation to solve (example: 8 + 2). The function should create a node, place in the private data for the node, including the answer which it must compute, and insert it at the end of the list. / and % perform integer arithmetic. An indication that a problem has been added should be printed.
remove_problem: Removes the last problem in the list. If there are no problems in the list, an error message should be printed. The removed node should be recycled. An indication that a problem has been removed should be printed.
print: Prints the problems in the list. They should be printed one per line, in equation form and should include the answers. If there are no problems to print, an error message should be printed.
quiz: Presents each problem in turn to the user. For example:
6 * 2 =
quiz indicates for each problem whether the user correctly answered it. When the user enters a wrong answer, the correct answer should be given. quiz should keep a tally of the number of problems correctly answered. It should print the number of problems correctly answered out of the total number at the end of the quiz. For example:
You got 7 problems out of 9 problems correct!
If there are no problems in the list, quiz should print an error message.