Question: In Java Objective: Write a program two classes that will complete this pepper judging program. First download the driver and include it in your project.
Objective: Write a program two classes that will complete this pepper judging program. First download the driver and include it in your project. Create a class Pepper with the following Instance variables o name: simply the name of the pepper o scoville Rating: a positive integer value determine hotness of a pepper. It ranges from 0 to 2.2 million Constructors o Default: sets both instance variables to false o Parameterized: Takes in two parameters that set the instance variables to those values Accessors and Mutators for every instance variable o CHECK FOR VALID VALUES! Other Methods o toString: returns a string with the name and the Scoville rating of the pepper Next create a class PepperCollection with the following Instance variable o peppers: An array of peppers Constructors o Default: Initializes the array to size 10 Accessor ONLY for the instance variable peppers Other Methods o addPepper: This method returns nothing and takes in a Pepper as a parameter, and adds a new instance of a pepper to the array. It should add it to the first null element and place the new pepper there. o sortPeppers: This method returns nothing and has no parameters, but it sorts the peppers from highest to lowest Scoville values. Also you must implement your own sorting algorithm and not use one built into java. o print Peppers: This method returns nothing and takes no parameters prints out all of the peppers in the array Peppers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
