Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The teacher wishes to see if her pupils can make sense of words in which certain letters have been duplicated. She requires a when[space]key_pressed script

The teacher wishes to see if her pupils can make sense of words in which certain letters have been duplicated.

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 first half of the alphabet (a to m inclusive) have been duplicated.

The user should input the word as a single string and the new word that is displayed should be a single string.

So for example if the user enters

'rhinocerous'

then

'rhhiinocceerous'

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

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 script.

Algorithm

1)START

2) Initialize i, temp,str

3) when the user press the space key then

4) Read a string from the user and store it in str

5) For each character in str

5.1)if the character c in 'abcdefghijklm' then

5.1.1)store c in temp at location i

5.1.2)Increment i

5.1.3)store c in temp at location I

5.1.4 ) increment i

5.2)else

5.2.1)store c in temp at location i

5.2.2)Increment i

6)display temp

7)STOP

I need help with the SCRATCH script, I have the algorithm already.

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

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

White lines separate traffic traveling in opposite directions

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago