Programming prjct
This is an individual assignment. Evidence of copying will be submitted as a violation of the honor code to the Dean of the College of Engineering and the Dean of Students.
Write a program in Python that is a study tool for the vocabulary terms in this course.
Step 1: Create 15 plain text files; one for each of the chapters from the book covered in this course. Name the files chl.txt, ch2.txt, etc. Each text file will contain at least 5 technical terms and their definitions from that chapter. Note that the chapters covered are 1-12, 14, 16, and 17.
Requirements: The program will prompt the user for a specific chapter or allow the user to select all chapters. Based on the user’s selection, it will then present relevant multiple-choice style questions in which a term is presented along with 4 possible definitions for that term. One of the definitions is correct. The other 3 definitions are pulled randomly from the definitions of other terms.
For each question, the program prompts the user to type a, b, c, d, (corresponding to the four definitions) or ‘q’ to quit the game at any time.
If the user gets the correct answer on their first try, they get a point. If not, that answer is removed that the user gets a second guess (now with only 3 choices, a, b, and c). If they get it right this time, they get 1/2 point. If they get it wrong, that answer is removed and the user gets a 3rd guess (now with only a and b as choices). If they get it right this time, they get 1/4 point. If not, no points are awarded, the correct answer is revealed, and they move to the next question.
Behind the scenes: The code will read in the terms and definitions from all of the previously mentioned text files and store them in one or more dictionaries. The question generation feature will access the dictionaries to generate the questions and answers, and also to check if the user got the correct answer.
Ending the game: The game will end when either: 1) All of the terms for the user’s selection have been presented OR 2) The user types ‘q’ At that point, the final score will be display as well as an encouraging message.