Create additional methods to select the random items

Assignment Help Basic Computer Science
Reference no: EM131608865

Question: 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 Box Of Produce that contains exactly three bundles of fruits or vegetables. You can represent the fruits or vegetables as three instance variables of type String. Add an appropriate constructor, accessor, and mutator methods. Also write a to String () method that returns as a String the complete contents of the box. Next, write a main method that creates a Box Of Produce with three items randomly selected from this list:

Broccoli

Tomato

Kiwi

Kale

Tomatillo

This list should be stored in a text file that is read in by your program. For now you can assume that the list contains exactly five types of fruits or vegetables. Do not worry if your program randomly selects duplicate produce for the three items. Next, the main method 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, output the final contents of the box to be delivered. If you create additional methods to select the random items and to select valid substitutions, then your main method will be simpler to write.

Reference no: EM131608865

Questions Cloud

Calculate the market to book ratio-price earnings ratio : What is Roxie's Bed & Breakfast's book value per share? Calculate the market-to-book ratio. Calculate the price-earnings ratio
How is conflict related to power : How is conflict related to power? What behaviors escalate a conflict (make it worse), and what behaviors deescalate a conflict
Is there a difference between price and value : Is there a difference between price and value? Why or why not? How do rectify the similarities or differences in relation to the behavior of the stock
Case analysis covering dispute issues : Provide a case analysis covering Dispute issues (such as meditation), business associations or securities issues surrounding the company Apple.
Create additional methods to select the random items : Your Community Supported Agriculture (CSA) farm delivers a box of fresh fruits and vegetables to your house once a week.
Improve your organizations communication : Provide an assessment of the conditions, channels, and strategies used by your organization -improve your organizations communication
What tools can be used for financial statement analysis : What tools can be used for financial statement analysis? What kinds of business decisions can be made using these tools?
Compare and contrast the types of supervision : Compare and contrast the types of supervision- Theory X and Y and free-rein leadership. Which is better for the department as a whole?
Determinants of interest rate for individual securities : Determinants of Interest Rate for Individual Securities You are considering an investment in 30-year bonds issued by a corporation.

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