Growing a Mango solution

Project No.2: Growing a Mango

This project consists of two parts. The first part is to write the code for class Mango, which is designed for a Mango tree that grows and whose fruits appreciate overtime. The second part is to write the code for class MansoSim, which conducts a simulation of growing various mango trees for a number of years, and produces information as to which mango tree will be the most profitable.

For the first part, we envision that each Mango tree has information about

    what kind it is, as a String, how tall the tree is, as an int (in inches), how much a fruit sells for, as an int (in cents).

Each year the tree receives some updates. First, the price appreciates by 1 percent.

Second, the tree grows. The growth in percentage ranges uniformly between 5 percent and 15 percent. However, if the tree grows too tall, it will go beyond the reach for pickers, and so it is trimmed down. We assume that whenever the tree grows taller than 260 inches it is trimmed down to 150 inches.

Leave a Reply

Your email address will not be published. Required fields are marked *