akosiraff

Download Produce CPP

Nov 5th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/produce-cpp/
  3. Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegeta- bles to your house once a week. For this programming project, de?ne the class BoxOfProduce that contains exactly three bundles of fruits or vegetables. You can represent the fruits or vegetables as an array of type string. Add appropriate constructors and accessor/mutator functions to get or set the fruits or vegetables stored in the array. Also write an output function that displays the complete contents of the box on the console.
  4. Next, write a main function that creates a BoxOfProduce with three items randomly selected from this list: • Broccoli • Tomato • Kiwi • Kale • Tomatillo Do not worry if your program randomly selects duplicate produce for the three items. Next, the main function should display the contents of the box and allow the user to substitute any one of the ?ve possible fruits or vegetables for any of the fruits or vegetables selected for the box. After the user is done with substitutions it should output the ?nal contents of the box to be delivered. Then it should ask if the user wants to create another box and if yes, it should repeat the above steps. It should keep doing so until the user chooses not to create another box of produce.
  5. Finally, add a static variable to your class that keeps track of the total number of boxes of produce created and a static function that returns that value. Display this value in the main function at the end of each iteration of the main loop.
  6. Filename: produce.cpp
  7. Download: http://solutionzip.com/downloads/produce-cpp/
Add Comment
Please, Sign In to add comment