Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pleas see attached screenshot. I did something wrong in script, is not correct. Please correct script from screenshot. I know that I should put all
Pleas see attached screenshot. I did something wrong in script, is not correct. Please correct script from screenshot. I know that I should put all consonants in a list but I just wanted to test word metal, and it didnt work. Its ou build. This is a task:
The teacher wishes to see if her pupils can make sense of words in which certain letters have been duplicated.
She requires a whenspacekeypressed script that will take a word from the user and display a new word that is the same as the original except that each consonant has been duplicated. For clarification, the consonants should be considered as: b c d f g h j k l m n p q r s t v w x y and z
The user should input the word as a single string and the new word that is displayed should be a single string.
For example, if the user enters
metal
then
mmettall
is displayed.
One way to create the new word to be displayed is to start with the new word as an empty string and then work through the letters in the original word from first to last, creating the new word incrementally. If the current letter is not a consonant then we add it to the new word, otherwise we add two of it to the new word.
Create a whenspacekeypressed script to implement your algorithm. Depending on your algorithm and the way in which you choose to implement it you may also decide to have a whengreenflagclicked script.
Take a screenshot of your scripts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started