Question: Create an OOP called class flower Its attributes are 3 integers - down , up , side and an int array called numbers . Add
- Create an OOP called class flower
- Its attributes are 3 integers - down, up, side and an int array called numbers.
- Add a constructor that takes in 3 integers and initializes the variable down, up, side in this constructor.
- 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
Get step-by-step solutions from verified subject matter experts
