1. For this project, you will use the bag class from Section 5.6, including the grab method that returns a randomly selected element. Use this ADT in a program that does the following:
1. Asks the user for a list of 10 nouns.
2. Asks the user for a list of 10 verbs.
3. Prints some random sentences using the provided nouns and verbs.
For example, if two of the nouns were “monkey” and “piano” and two of the verbs were “eats” and “plays,” we can expect any of these sentences:
Needless to say, the sentences are not entirely sensible. Your program will need to declare two bags: one to store the nouns and one to store the verbs. Use an appropriate top-down design.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here