Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hlp Klingon Quiz Problem Version 4: Live long and prosper! This is the final version of your Klingon Quiz program. Now, you will show an

hlp image text in transcribed
image text in transcribed
image text in transcribed
Klingon Quiz Problem Version 4: Live long and prosper! This is the final version of your Klingon Quiz program. Now, you will show an additional (random!) hint after the second incorrect answer. Qapla'! What to do Already implemented: 1. Read data from klingon-english.txt 2. Ask the user to choose a Klingon consonant they want to practice with. Ask again if the user's answer is not a valid Klingon consonant, until the user enters a valid consonant. 3. Find a Klingon word that starts with the chosen consonant (the text file contains only one word that starts with any given consonant, so you don't need to use the random library) 4. Ask the user to translate the chosen word into Klingon 5. Print correct if the user's answer is correct 6. Print sorry, you're wrong! if the user's answer is wrong You will refactor in this version: 7. If the answer is incorrect, show the first hint: the first and last characters of the correct Klingon word. When showing a hint, replace all other characters with a star () 8. If the answer is still incorrect, show the second hint: the first and the last characters plus an extra random character of the correct Klingon word. 8. If the answer is still incorrect, show the second hint: the first and the last characters plus an extra random character of the correct Klingon word. Already implemented: 9. Print The correct answer is ... if all three user's answers are wrong You must read data from the provided text file, that is absolutely essential in this lab assignment. You can not hardcode the words. Hints 1. In Python, strings are immutable. In this version, you need to update the hint. Maybe there is a mutable type that you can use for that? Program name Save your program as klingon-quiz4.py. To make sure your program works correctly, you should test it. At this point, there are many test cases that you should consider. Refer to the screen recording above for some ideas. Come up with your own test cases for this program. Submitting Submit klingon-quiz4,py via eClass. You may submit either all versions you complete, or only the final version

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Progress Monitoring Data Tracking Organizer

Authors: Teacher'S Aid Publications

1st Edition

B0B7QCNRJ1

More Books

Students also viewed these Databases questions