1

Array Processing - Dictionary Program NOTE: Review the parallel array example from class Another method of...

Question

Array Processing - Dictionary Program NOTE: Review the parallel array example from class Another method of...

Array Processing - Dictionary Program NOTE: Review the parallel array example from class Another method of "Sequentially Searching an Array" is covered in the book in Chapter 8. Using Notepad, write psuedocode ONLY for the following situation. Create and load an array with the following 7 values. Add one more word (of your own choosing) for a total of 8 words. biff comely fez mottle peruke bedraggled quisling Create a second array (parallel array). To hold the defintions to these words. You will need to look up the definitions. - 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). 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.

Answers

Psuedocode:

START         // initialising arrays wordsArray and defArray with size 8         len = 8 // length of array         wordsArray[len]         defArray[len]         // open words.txt file and write each line to wordsArray array         wFile = open "words.txt"         i = 0 // maintains index of array         for each line in wFile:                 wordsArray[i] = line                 i++         // open definitions file and write each line to defArray array         defFile = open "definitions"         j = 0 // maintains index of array         for each line in defFile:                 defArray[j] = line                 j++         // take input a word to search from user         searchWord = input from user         // boolean flag to check word found in array or not         found = false         // iterate on the array of wordsArray         for k = 0 to (len - 1):                 // if search word matches with the current word in the array at index k                 // print definition of this word stored at kth index in defArray array                 if wordsArray[k] == searchWord:                         print "Yes, that word is in the dictionary"                         print defArray[k]                         break // break the loop if search successfull         // if search is unsuccessfull         if found == false:                  "No, that word is not in the dictionary" END

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 START // initialising arrays wordsArray and defArray wit


Similar Solved Questions

2 answers
Angular acceleration
A person of mass 75 kg stands at the center of a rotating merry-go-round platform of radius 3.0 m and moment of inertia 1200 kg·m2. The platform rotates withoutfriction with angular velocity 1.0 rad/s. The person walks radially to the edge of the platform.Calculate the angular velocity when t...
1 answers
What are radioactive isotopes?
What are radioactive isotopes?...
1 answers
Find the p-value show work. STA 3123 U01- Spring 2019 omework: Section 8.5 Homework core: 0...
Find the p-value show work. STA 3123 U01- Spring 2019 omework: Section 8.5 Homework core: 0 of 1 pt Kath 70f9(9 complete) ▼ 8.5.57-T sample of five measurements, randomly selected from a normally distributed population, resulted in the folowing summary statistics: x 4.7, s1.2. Complete par...
1 answers
Jefferson & Sons is evaluating a project that will increase annual sales by $90,000 and annual...
Jefferson & Sons is evaluating a project that will increase annual sales by $90,000 and annual costs by $35,000. The project will initially require $140,000 in fixed assets that will be depreciated straight-line to a zero book value over the 10 year life of the project. The applicable tax rate i...
1 answers
Find the Isometrics (3D object) Thank you A N
Find the Isometrics (3D object) Thank you A N...
1 answers
3.Consider a galvanic cell based on the reaction. Assume theses reactions are carried out in acidic...
3.Consider a galvanic cell based on the reaction. Assume theses reactions are carried out in acidic media and that all concentrations are 1M and that all partial pressures are 1 atm. a) MnO4 (ag)+ CIO3 (ag) CIO4 (ag) + Mn (aq) b) Cr (aq+ Cl2(ag) Cr O2 +CI (aq) (aq) For each the above overall reactio...
1 answers
What is the point-slope form of the line that passes through point (4, 1) with a slope of -4?
What is the point-slope form of the line that passes through point (4, 1) with a slope of -4?...
1 answers
Very briefly describe the major differences between voltaic and electrolytic cells. You will not need all...
Very briefly describe the major differences between voltaic and electrolytic cells. You will not need all of the space given here to answer the question....
1 answers
Suppose that f(x) = e-x for x > 0. Determine the following probabilities: Round your answers...
Suppose that f(x) = e-x for x > 0. Determine the following probabilities: Round your answers to 4 decimal places. a) P(X=3)...
1 answers
3. Given the following simple distillation column system, Stream 2 Faw [kg water/hr] Fis Ikg solute/hr]...
3. Given the following simple distillation column system, Stream 2 Faw [kg water/hr] Fis Ikg solute/hr] Stream 1 Fiw kg water/hr] Fis kg solute/hr] Stream 3 Fsw [kg water/hr] Fzs Ikg solute/hr] And the following information about the system: 1. The total flow rate of the feed (ie. Stream 1) is 2000 ...
1 answers
#1 Martin Compary currently sells its products for $240 per unit Management is contemplating a 40...
#1 Martin Compary currently sells its products for $240 per unit Management is contemplating a 40 % increase in the selling price for the next year. Variable costs are curently 10% of sales revenue and are not expected to change naxt year Fixed expenses are $130,000 per year f foed costs inrease ...
1 answers
A survey collected data on annual credit card charges in seven different categories of expenditures: transportation, groceries, dining out, household expenses, home furnishings, apparel, and entertain...
A survey collected data on annual credit card charges in seven different categories of expenditures: transportation, groceries, dining out, household expenses, home furnishings, apparel, and entertainment. Using data from a sample of 42 credit card accounts, assume that each account was used to iden...
1 answers
If someone explain how to find these unknowns..And what they are and how you got the...
If someone explain how to find these unknowns..And what they are and how you got the answer. I am having a hard time really understanding NMR and IR.. Thanks in advance Unknowns for 1H NMR Final Report 4) Chemical Formula: CH360 IR: strong broad peak at 3300cm PPM 5) Chemical Formula: CsHN IR: Two w...
1 answers
Need explanation on how to get these answers using excel or which formula to do A...
Need explanation on how to get these answers using excel or which formula to do A consultant wants to test whether it makes sense to incur the costs of moving canned salmon into Winnipeg from Toronto. She asked 100 people shopping in a Winnipeg store if they liked canned salmon, and 63% said yes. Sh...
1 answers
Clicker question 5 You are studying two linked genes that influence hair type and eye color...
Clicker question 5 You are studying two linked genes that influence hair type and eye color in mice. Straight hair (H) is dominant over curly (h), and brown eyes (E) are dominant over blue (e). You get the following numbers of offspring from a dihybrid testcross: Straight hair, blue eyes 101 Curly h...
1 answers
Thx 11. A subgroup H of a group G is called normal if for all r E G, the left coset rG is equal to the right coset Gr. I...
thx 11. A subgroup H of a group G is called normal if for all r E G, the left coset rG is equal to the right coset Gr. In each of the following cases, define whether H is a normal subgroup of G You do not need to show it is a subgroup. (a) G-S3, H e, (1,2)) (b) G = GL(2, R) (with operation matrix mu...

-- 0.035413--