Community supported agriculture

Assignment Help Basic Computer Science
Reference no: EM13324946

c++ program
BoxOfProduce Class
Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegetables to your house once a week. For this programming project, define the class BoxOfProduce that c o n t a i n s 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 d i s p l a y s the complete contents of the box on the console.
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 five 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 final 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.
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.

 

Reference no: EM13324946

Questions Cloud

Cross-examination by partys attorney during deposition : Do you think cross-examination by a party's attorney during a deposition is common? Why or why not? There are several reasons any particular case will go to trial. Some of these may also affect the pretrial conference. Which ones and why?
Develop a two-page brief on email or phishing scams : Develop a two-page brief on email or phishing scams reported within the past six months. Indicate who they were directed to, who might be behind these attacks and why. Also address any similarities/differences between similar previous attacks.
Find the force of reaction between the blook and the box : a spring of stiffiness k supports a box of mass M in which is placed a blokk of mass m. find the force of reaction between the blook and the box
Difference btween deductive-inductive paragraph organization : In planning to write a document, what questions must a manager ask before putting words on paper? Should they all receive equal emphasis? What is the difference btween deductive and inductive paragraph organization? Give an example of each.
Community supported agriculture : Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegetables to your house once a week. For this programming project, define the class BoxOfProduce that c o n t a i n s exactly three bundles of fruits or vegetab..
Determine the width of the central bright fringe : Red light of wavelength 633nm from a helium-neon laser passes through a slit 0.370mm wide. What is the width of the central bright fringe
Create a class named student that has three member variables : Create a class named Student that has three member variables
Some disadvantages of using hackneyed phrases and jargon : Note several aspects of the context of managerial writing that make it unique. What are some of the advantages of short words over long words? Give examples of some recent obvious euphemisms used by people in advertising, public relations, or governm..
How high would he go : When jumping, a flea reaches a takeoff speed of 1.0m/s over a distance of 0.48mm. how high would he go

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd