Question: I am trying to get help in Scheme using DrRacket. In the language of an alien race, all words take the form of Blurbs. A
I am trying to get help in Scheme using DrRacket.
In the language of an alien race, all words take the form of Blurbs. A Blurb is a Whoozit followed by between zero or more Whatzits. A Whoozit is the character x followed by between one or more ys A Whatzit is a q followed by either a z or a d followed by a Whoozit.
You need to design and implement this program in a declarative language, Scheme.The program should have the following features:
The program should ask the user to Enter an alien word: read the input as a string, and check whether or not it is a valid word Blurb If it is valid, it prints "The word is fine.", otherwise it prints "The word is a mess!".
The program should loop and ask the user for new input until they enter a valid blurb.
Hint:
Start by trying to generate Whoozits, Whatzits, and Blurbs by hand and on paper. Be sure to follow that order. Once you have a feeling for the structure of the language, then start to think about how you might program it
Once you have the program, test for Whoozits first, followed by Whatzits, and then Blurbs. For each method, test it by running it on known valid strings as well as some invalid ones.
For Scheme, it is suggested that you review the inputandoutput.rkt sample program from the first module on functional programming. This program shows how to perform a loop that reads in data and processes it You may find the following forms useful:
aread to read a string
bstringlist to convert the string into a list of characters,
cdisplay Hello to write Hello to the screen.
dbegin to help with displaying an output while not breaking out of the running procedure.
Sample output:
Enter an alien word:
qxxyyyy
The word is a mess!
Enter an alien word:
xyyyyqzqd
The word is a mess!
Enter an alien word:
xyyyyyqzxyyy
The word is fine.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
