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...


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.





Nov 28, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here