Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9904246
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Some seem to believe that we should be pure maximizers

Some seem to believe that we should be pure maximizers. Others say that we do better as constrained maximizers. Which view does David Schmidtz endorse and why?

Rock paper scissors please make sure it compiles and

Rock, Paper, Scissors (Please make sure it compiles and include output in answer.) You will implement a rock-paper-scissors game. The player enters 1 for Rock, 2 for Paper, or 3 for Scissors. The computer randomly select ...

Suppose that you want an operation for the adt list that

Suppose that you want an operation for the ADT list that adds an array of items to the end of the list. The header of the method could be as follows. public void addAll(T[] items) Write an implementation of this method f ...

Why would the communities in the territories not be listed

Why would the communities in the territories not be listed for government transfer payments? Why do cities and towns get government transfer income?

Question in the link below it has all the information that

Question: In the link below it has all the information that needs to be in the crowsfoot erd. Don't take on this assignment if you cant put all the info in the ERD. The instructor will grade the work that you do and send ...

Question suppose you have to design a mobile application to

Question : Suppose you have to design a mobile application to control your microwave over internet. Define the objective, assumptions and Interface Metaphors of this application.

What is the difference between dekkers algorithm and igloo

What is the difference between Dekkers Algorithm and Igloo approach? Please provide examples that can explain this.

Will anyone help me with this and give me the explain how

Will anyone help me with this and give me the explain how did you get the answer? No coding necessary. Give truth tables for each the following Boolean expressions. a) not (P and Q) b) (not P) and Q c) (not P) or (not Q) ...

Assignmentsuppose you are an isp that owns a 19 address

Assignment Suppose you are an ISP that owns a /19 address CIDR block starting at 118.235.160.0/19. Answer the following questions to allocate address blocks to 10 customers who want to pay for the smallest CIDR blocks to ...

What are some of the skill sets required for the various

What are some of the skill sets required for the various aspects of cloud administration. Are there any certifications related to cloud computing? Is there value in obtaining one of these certifications?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As