Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Write a Python program to implement a spelling game that a player can play repeatedly. Assume these TEN (10) words are stored as a

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

a) Write a Python program to implement a spelling game that a player can play repeatedly. Assume these TEN (10) words are stored as a string: meringue albumen foulard eudaemonic narcolepsy elucubrate vivisepulture pococurante cymotrichous malfeasance Randomly pick one word for the player to spell. The player guesses ONE (I) letter at a time, and can guess a maximum of FIVE (5) letters after which he must spell the whole word. For each correctly guessed letter, show the letter in all its position in the word. Refer to the sample run. If a player has guessed at least a correct letter and he has not exhausted the FIVE 5) letters guesses, prompt the user whether he wishes to spell the whole word. This means that the player can spell the whole word without having to complete FIVE (5) guesses of individual letters, as long as he has guessed one letter correctly. The word will be removed if the player manages to spell it cormectly The program prompts the player whether he wants to spell a new word if there are words that have not been chosen yet or words that he has not spelt correctly yet. The user should enter n if he wishes to exit the program. Before exiting, the program displays the number of remaining words that have not been chosen yet and words that he has not spelt comectly yet and lists of those words on a separate line An example run of the program is shown below (characters in green are user input): The word has 7 letters. Spell it in 5 tries Try 1-current: . Your guess? 1 Outcome: - Outcome: - Try 3 - current: . Your guess? a Outcome: a--- Do you want spell the word now? (y): y Spell the complete word: albumen You are correct! The correct word is albumen spell another word? (y): y The word has 11 letters. spell it in 5 tries Try 1 . Current: .. Your guess? a Outcome: -a---a-a Do you want spell the word now? (y): n Try 2 Current: aa-a---. Your guess? e Outcome: -a--ea-a--e Do you want spell the word now? (y): n Try 3 Current: a--ea-a--e. Your guess? i Outcome: -a--ea-a--e Do you want spell the word now? (y): y Spell the complete word: malseasance Spell another word? (y): y The word has 11 letters. spell it in 5 tries Try 1 - current: outcome : Try 2 . Current: " Your guess? b outcome : Try 3 . Current: " Your guess? d outcome : Try 4-Current: " Your guess? z outcome : Try outcome : . Your guess? 1 5 Current : .._....-..-. Vour guess? q Spell the complete word: I don't know You are incorrect. The correct word is malfeasance Spell another word? (y): n 9 remaining words: meringue foulard eudaemonic narcolepsy elucubrate vivisepulture pococurante albumer cymotrichous malfeasance Thank you for playing Spell The Word

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

ISBN: 1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

What would I do next and why?

Answered: 1 week ago