Question: Create an OOP called class flower Its attributes are 3 integers - down , up , side and an int array called numbers . Add

  1. Create an OOP called class flower
  2. Its attributes are 3 integers - down, up, side and an int array called numbers.
  3. Add a constructor that takes in 3 integers and initializes the variable down, up, side in this constructor.
  4. Add a method called createArray that

a. adds values to the array numbers,

b. the first number in the numbers array is start, the second number in the array is incremented by the value of step and so on till the value in the array is <= up

c. adds the numbers to the Array

5. Add a method called printAverage() that prints out the avergare of the non-zero elements of the array.

d. prints out the average of the numbers in the array

java program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!