Array Processing - Dictionary Program Using MS Word, write psuedocode ONLY for t
ID: 3683769 • Letter: A
Question
Array Processing - Dictionary Program
Using MS Word, write psuedocode ONLY for the following situation.
Create and load an array with the following 8 values.
biff
comely
fez
mottle
peruke
bedraggled
quisling
rage
Create a second array (parallel array). To hold the defintions to these words. You can just put look up word where the definition should go for time sake.
- Be sure to use lowercase, as shown above. This will make the processing easier.
- Use an external .TXT file to load the words and the definitions into the arrays ( words.txt and definitions.txt). you can fake the txt file
Ask the user to enter a word
- Search through this array until you find a match with the word the user entered.
- Once you find a match, output "Yes, that word is in the dictionary" and output the definition.
- If you get to the end of the array and do NOT find a match, output "No, that word is not in the dictionary".
- The program should work with any set of words and definition in the arrays. If I were to change the words and definitions in the arrays, it should still work.
Please write in pseudocode
Explanation / Answer
//loading words into word array from words.txt
1.
1.1 read words.txt
1.2 char words[][] = {"biff","comely","fez","mottle","peruke","bedraggled","quisling","rage"}
// create definition array to store definition of words
2.
2.1 read definition.txt
2.2 char definitions[][] = {// definition of each word}
3. int N <- number of words in words array
4. input <- enter a word(user input)
5. int j;
5. for i:1 to N do
if words[i] = input
j =i;
6. if(i > N) // not found
print "No, that word is not in the dictionary"
7 else{
print "Yes, that word is in the dictionary"
print definition[j]
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.