If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

abstract methods and classes, need help and guidance very bad.

I am trying to complete this task and I am to a certain point I need some guidance.
my first task is as follows..........

task: Develop an abstract class called Recipe with the following elements:
• Instance Data: number of servings (an integer)
• Constructor method which accepts number of servings as a parameter, and assigns it to the instance variable.
• An abstract method named setIngredients, which accepts a String array as a parameter.

if anyone sees something I can improve or that would create an error. I am looking for help and criticism on how I can do this better or fix it.
and my code:

my next task is as follows.....
second task: Develop another class called CookieRecipe which extends Recipe. Include the following:
• Instance Data: cookTime (a String); cookTemperature(an integer); ingredientList [] (a String array)
• A Constructor which receives number of servings as a parameter, and then passes it to the constructor of the parent class using super.
• setIngredients method which receives a String array representing a list of ingredients.****NEED HELP WITH THIS
• Two other “setters” – for cookTime and cookTemperature
• A toString method to print a description of the object, including the ingredient list, the cookTime and the cookTemperature.*****ALSO NEED HELP WITH THIS

Last task is as follows.... I need a lot of help on this one.......
TASK: Create the “Driver” class, named RecipeDriver, consisting of a main method which does the following:
• Create a String array of the ingredients, for example: "sugar", "milk", "raisins", etc. Each ingredient is an element of the array.
• Instantiate a CookieRecipe object
• Call the setIngredients method, passing the array of ingredients.
• Call the setCookTime and setTemperature methods, passing as arguments the time and temperature from your recipe, respectively.
• Print the instantiated object (using your toString method description)