You are to write a program which generates random SWIFTIES. A swifty, for the purposes of this problem, is a sentence as defined by the syntax diagram below. The diagrams for Intransitive Verb, Transitive Verb, Noun and Adverb have not been included in the diagram since these are specific lists of words which will be supplied as input. Consult the Sample Input below for examples of these words. Consult the Output below for example of swifties.
Your program will need a random number generator which should be programmed using the linear congruence method. That is, given an initial number X0>0, new pseudorandom numbers are generated using the equation
where for this problem a=809, c=13 and m=1993.
If you read the same seed and input vocabulary, your program will give the same set of swifties on each run. For different seeds, you will generate a different set of swifties. [Note however, that two different programs running with the same seed may generate different sets.]
| 1. | An arbitrary seed value ( X0 for the random number generator) |
| Note: inputs 2-6b are repeated until the number of swifties to be generated is zero or less. Once a zero (or negative) number is read as the number of swifties to be generated, the program terminates. | |
| 2. | The number of swifties to be generated |
| 3a. | The number of adverbs for this generation set. |
| 3b. | A list of adverbs. Each is on a separate line and is preceded and followed by at least one blank. |
| 4a. | The number of nouns for this generation set. |
| 4b. | A list of nouns. Each is on a separate line and is preceded and followed by at least one blank. |
| 5a. | The number of transitive verbs for this generation set. |
| 5b. | A list of transitive verbs. Each is on a separate line and is preceded and followed by at least one blank. |
| 6a. | The number of intransitive verbs for this generation set. |
| 6b. | A list of intransitive verbs. Each is on a separate line and is preceded and followed by at least one blank. |
The syntax diagram for this problem is as follows.
391 4 3 ruthlessly intrepidly breathlessly 3 rowboat idea program 4 disguise encourage destroy love 2 quit breathe 2 3 belatedly forcibly warmly 1 mouthwash 1 broke 1 melted 0Sample Output
I quit said Tom ruthlessly. I encourage your rowboat said Tom intrepidly. I love my program said Tom ruthlessly. I breath said Tom breathlessly. I broke the mouthwash said Tom forcibly I melted said Tom warmly.