Questions
Please include all classes including driver. IN JAVA Suppose that there is a big farm in...

Please include all classes including driver.

IN JAVA

Suppose that there is a big farm in California that supplies the majority of the Grocery stores in the twin cities with vegetables and fruits. The stores submit their orders and receive the shipment a week later. Based on the size of the orders, the farm management decides on the size of the truck to load.

Create a Produce class that have an instance variable of type String for the name, appropriate constructors, appropriate accessor and mutator methods, and a public toString() method. Then create a Fruit and a Vegetable class that are derived from Produce. These classes should have constructors that take the name as a String, the price (this is the price per box) as a double, the quantity as an integer, and invoke the appropriate constructor from the base class to set the name. Also, they should override toString method to display the name of the produce, the price, and its type. For instance, Mango is a Fruit and Cauliflower is a Vegetable.

Finally, create a class called TruckOfProduce that will keep track of the boxes of Vegetables and Fruits added in to the truck. This class should use an array of Produce to store both vegetables and fruits. Also, it should have the following:

• Constructor that accepts an integer to initialize the array of Produce

• addProduce method that adds either fruit or vegetable to the array

• search method that accepts a name string, which can be either the name of a fruit or vegetable, and returns true if the name exists. Otherwise, it returns false.

• remove method that accepts a produce object and returns true if the produce is found and removed successfully. Otherwise, it returns false.

• computeTotal method that will return the total cost of all the produce in the truck.

• toString method that returns all the produce from in the truck.

• ensureCapacity method this is a void method. When this method is called it will double the size of the array and copy all the content of the smaller array in to this bigger array.

For instance, one could initialize the array to hold 1000 boxes of vegetables and fruits. What will happen if you try to add one more box (1001)? Of course, you will get an ArrayIndexOutOfBound error. So, thing about ensureCapacity as the method that will solve ArrayIndexOutBound error.

Then wrap it up with the driver class that tests all methods and displays the name of the produce, the price, and its type.

In: Computer Science

What is your percent difference from the manufacturer’s claim for the aspirin content? Explain how our...

What is your percent difference from the manufacturer’s claim for the aspirin content? Explain how our method may have led to such a difference. (Among other things, consider how the solutions were prepared and the difference between the pure ASA solutions and those prepared from the tablet.) ! Discuss two ways to improve the experiment.

In: Chemistry

In this experiment, 0.100 g of caffeine is dissolved in 4.0 mL of water. The caffeine...

In this experiment, 0.100 g of caffeine is dissolved in 4.0 mL of water. The caffeine is extracted from the aqueous solution three times with 2.0-mL portions of methylene chloride. Calculate the total amount of caffeine that can be extracted into the three portions of methylene chloride. Caffeine has a distribution coefficient of 4.6, between methylene chloride and water.

In: Chemistry

In this experiment, 0.170 g of caffeine is dissolved in 10.0 mL of water. The caffeine...

In this experiment, 0.170 g of caffeine is dissolved in 10.0 mL of water. The caffeine is extracted from the aqueous solution three times with 5.0-mL portions of methylene chloride. Calculate the total amount of caffeine that can be extracted into the three portions of methylene chloride. Caffeine has a distribution coefficient of 4.6 between methylene chloride and water.

In: Chemistry

A genetic experiment with peas resulted in one sample of offspring that consisted of 424 green...

A genetic experiment with peas resulted in one sample of offspring that consisted of 424 green peas and 163 yellow peas.

a. Construct a 95​% confidence interval to estimate of the percentage of yellow peas.

b. It was expected that​ 25% of the offspring peas would be yellow. Given that the percentage of offspring yellow peas is not​ 25%, do the results contradict​ expectations?

In: Statistics and Probability

23 mg of nitrogen gas, assumed to behave ideally, at a pressure of 88 torr and...

23 mg of nitrogen gas, assumed to behave ideally, at a pressure of 88 torr and at 22oC undergoes an adiabatic free expansion into a vacuum (Joule experiment) to a final pressure of 34 torr.

a) Is the process reversible? Why or why not?
b) What is the final temperature of the system? Why? [ answer should be 22oC]
c) What is ∆S for the system?

In: Chemistry

After studying alternating current waveforms, half-wave rectification and capacitor smoothing, a student proposes the following hypothesis:...

After studying alternating current waveforms, half-wave rectification and capacitor smoothing, a student proposes the following hypothesis:
The peak-to-peak value of the ripple voltage obtained with a capacitor smoothed, half-rectified sinusoidal waveform is proportional to the logarithm (base 10) of the value of the smoothing capacitor used.
Design an experiment to verify the hypothesis above

In: Physics

A genetic experiment with peas resulted in one sample of offspring that consisted of 423 green...

A genetic experiment with peas resulted in one sample of offspring that consisted of

423

green peas and

166

yellow peas.

a. Construct a

95​%

confidence interval to estimate of the percentage of yellow peas.

b. It was expected that​ 25% of the offspring peas would be yellow. Given that the percentage of offspring yellow peas is not​ 25%, do the results contradict​ expectations?

In: Statistics and Probability

Consider an HPLC analysis. Which term in the van Deemter equation plays a minimal role in...

Consider an HPLC analysis. Which term in the van Deemter equation plays a minimal role in
determining the theoretical plate height (H)? Justify your answer.

Consider a capillary column GC experiment. Which term in the van Deemter equation is most
strongly affected by increasing the inner diameter of the column? Justify your answer.

In: Chemistry

Part A In the following experiment, a coffee-cup calorimeter containing 100 mL of H2O is used....

Part A

In the following experiment, a coffee-cup calorimeter containing 100 mL of H2O is used. The initial temperature of the calorimeter is 23.0 ∘C. If 4.00 g of CaCl2 is added to the calorimeter, what will be the final temperature of the solution in the calorimeter? The heat of solution ΔHsoln of CaCl2 is −82.8 kJ/mol.

Express your answer with the appropriate units.

Hints

In: Chemistry