The teacher wishes to see if her pupils can make sense of words from which certain letters have been removed.
She requires a when[space]key_pressed script that will take a word from the user and display a new word that is the same as the original except that all letters in the second half of the alphabet (n to z inclusive) have been removed.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’rhinocerous’then’hice’is displayed.One way to think about creating the new word for display 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. This might be visualised as in Figure 2.Figure 2a.Create and write down an algorithm to solve this problem. You might like to use the ideas above, or alternatives of your ownb.Create a when[space]key_pressed 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 when_green_flag_clicked scriptaaadd to it two tests you would perform to check whether the completed program fulfills the specification. (Several tests might be appropriate: you are only required to add twoTest numberTest purposeInputsExpected resultsWordNew word displayed1No letters in second half of alphabetcalfcalf2 3
Explanation & Answer:
User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.