Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem 1) prepare a program that does the following:

A farm delivers the box of fresh fruits and vegetables to your house once a week. For this assignment, define a class BoxOfProduce which contains exactly three bundles of fruits or vegetables. You could represent fruits or vegetables as the array of type string. Add suitable constructors and accessor/mutator functions to get or set fruits or vegetables stored in array. Also prepare the output function which displays complete contents of the box on the console.

Next, prepare a main function which creates a BoxOfProduce with three items randomly selected from this list:

Broccoli
Tomato
Kiwi
Kale
Tomatillo

Don’t worry if your program randomly chooses duplicate produce for the three items. Next, main function must display contents of box and allow the user to substitute any one of the possible fruits or vegetables for any of the fruits or vegetables selected for the box. After the user is done with substitutions it must output the final contents of the box to be delivered. Then it must ask if user wants to create another box and if yes, it must repeat the above steps. It must keep doing so until user selects not to create another box of produce.

At last, add the static variable to your class which keeps track of the total number of boxes of produce created and a static function that returns that value. Display this value in main function at the end of each iteration of the main loop.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M94655

Have any Question? 


Related Questions in C/C++

Assignmentgoals developing problem-solving skills declaring

Assignment Goals: Developing problem-solving skills, declaring variables, multi-way branches, data validation. Problem: Complete Programming Challenge 4.19 in your text book. Do not accept values larger than 10 meters or ...

C-programmingcreate a c program that sorts a sequence of

C-Programming Create a C program that sorts a sequence of positive numbers using the bubble sort algorithm in an increasing or decreasing order based on the user's choice. The pseudo code for the bubble sort algorithm is ...

Write a program that reads numbers from cin and then sums

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while, do - while , and for loops. Add the following to your program: ...

Assessment taskthis coursework will allow you to

Assessment Task: This coursework will allow you to investigate some of the issues involved in writing threaded programs. You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how ...

Assignmentobjectivespractice reading characters from a

Assignment Objectives Practice reading characters from a file Practice using command line input Practice using command-line redirection of files Practice implementing a double transposition ciphering algorithm Summary In ...

Object-oriented programming assignmentintroduction -nbspa

Object-Oriented Programming Assignment Introduction -  "A logical matrix or (0, 1) matrix is a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent a binary relation between a pa ...

Create your own unique while-end repetition structure you

Create your own unique While-End repetition structure. You decide the theme. You should provide both the pseudocode and the flowchart of your example. Be sure to provide an overview of what your repetition structure is d ...

Assignmentoverviewthis assignment consists of implementing

Assignment Overview This assignment consists of implementing an application using the techniques learned in the first half of the course. Examples on how to use file operations, random number generation, the standard tem ...

C projectphase 11- you need to take input from user study

C project Phase 1 1- You need to take input from user study year (proper value check from 1 to 4) 2- Take input semester (proper value check 1 to 8) 3- Calculate GPA (use Loop, calculate GPA for semester 1,2,3...) Exampl ...

Write a program that reads numbers from cin and then sums

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while ,do - while , and for loops. Add the following to your program: ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen