Question: Hello, In need of help with this Java pa homework. Thank you! 2. Create a normal (POJo, JavaBean) class to represent, i. e. model, varieties

Hello,

In need of help with this Java pa homework. Thank you!

Hello, In need of help with this Java pa homework. Thank you!

2. Create a normal (POJo, JavaBean) class to represent, i. e. model,

2. Create a normal (POJo, JavaBean) class to represent, i. e. model, varieties of green beans (also known as string beans or snap beans). Following the steps shown in "Assignment: Tutorial on Creating Classes in IntelliJ", create the class in a file of its own in the same package as class Main. Name the class an appropriate name. The class must have (a) private field variables of appropriate types for variety, pod length and number of seeds in the pod. Variety must not be set to empty. Pod length must be set to a value greater than zero. The number of seeds in the pod must be zero or greater. (b) a public getter (accessor) and setter (mutator, manipulator) for each private field variable. The getters must not have parameters. The setters must have only one parameter. (c) a public default constructor, i. e. a constructor without parameters. (d) a parametrized constructor, i. e. a constructor with parameters, one parameter for each of the private field variables. 3. In the class Main, (a) create a void method that when passed an array of green bean class type, outputs the information about each green bean object referenced by the elements of the array passed to the method. If an element of the array has the value null, nothing is output for that element. (b) Create a method that when passed an array of green bean class type, returns the average length of the pods of the beans referenced by the elements in the array. Be sure to not count or try to get data from the elements or the array that have the value null. (c) Create a method that when passed an array of green bean class type, returns the average number of seeds in the pods of the beans referenced by the elements in the array. Be sure to not count or try to get data from the elements or the array that have the value null 4. In method main of class Main, (a) create an array of your green bean class type that can hold 10 elements of green bean class type, then assign i. a unique object of green bean class type to 7 of the elements, each object of a different variety. Some green bean varieties are string bean, filet beans, long beans, purple string beans, flat beans, wax beans and bush beans. 11. null to the remaining elements with the proviso that null cannot be assigned to adjoining (neighboring) elements. (b) Call the three methods created in step #3, passing each the array create above and output the values returned from the non-void methods

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!