Need Help for Java Homework Assignment, Can someone Please help me ?

This is the program that I am supposed to write, and I am terrible confused, as it takes at least 3 different files.
Write a class named GroceryList that representss a person's list of items to buy from the market, and another class named GroceryItemOrder that represents a request to purchase a particular item in a given quantity. (I.E. four boxes of cookies).
**The GroceryList class should use an array field to store the grocery items, as well as keeping track of its size (number of items in the list so far). Assume that a grocery list will have no more than 10 items. A GrocerList object should have the following methods:
public GroceryList()
Constructs a new empty grocery list.
public void add(GroceryItemOrder item)
Adds the given item order to this list, if the list is not full (i.e., has fewer than 10 items).
public double getTotalCost()
Returns the total sum of all grocery item orders in this list.
The GroceryItemOrder class should store an item quantity and a price per unit. A GroceryItemOrder object should have the following methods:
public GrocerItemOrder(String name, int quantity, double pricePerUnit)
Constructs an item order to purchase the item with the given name, in the given quantity, which costs the given pricer per unit.
public double getCost()
Returns the total cost of this item in its given quantity. I.E. 4 boxes of cookies that cost 2.30 per unit, have a total cost of 9.20.
public void setQuantity(int quantity)
Sets the grocery item's quantity to be the given value.
Any suggestions would be sincerely appreciated.
Thanks.

Pete,
I having difficulty with the main class, and getting console to store a users input into a string array ... I will post the code that I have so far. Sorry I am trying real hard to learn ... and just having a frustrating time.
This is what I have in the main file.
import java.util.*;
public class Chapter_8 {
     public static void main(String []args){
          Scanner console = new Scanner(System.in);
          System.out.println("Please enter the first item of your list");
          String[]GroceryList = console.next();
          System.out.println("Please enter the next item of your list");
          String[]GroceryList = console.next();
          System.out.println("How many would you like to buy?");
          int quantity = consolenextInt();
     }This is what I have in the GroceryItem Class file:
public class GroceryList{
public GroceryList(){
Static String []GroceryList ={"beans", "macaroni", "milk", "cheese", "bread", "eggs","hamburger","Hotdogs","peas","cookies"};
for(int i=0;i<5;i++){
System.out.println(GroceryList);
And the final file that I have is the GroceryItemOrder Class file:public GroceryItemOrder(String name, int quantity, double pricePerUnit){
this.name = name;
this.quantity = quantity;
this.pricePerUnit = pricePerUnit;
public double getCost(){
public void setQuantity(int quantity){
Sorry, I know it isn't much, that's why I am frustrated.
Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

Maybe you are looking for

  • Problem with S001 - Key field Sequence in table

    Hi, We want to use the extractor 2LIS_01_S001 with Delta. But delta is not working with these extractor. When I checked LBW0, I am getting error "The LIS environment is setup incorrectly". According to note 115192, the key fields in tables S001, S001

  • What is the maximum level that a role can be resolved to?

    hi folks can anyone tell me what is the maximum level at which expand role works. for example if i have a role which is then having 3 roles, each role has 2-3 users. will expand role work in this scenario? Also plz tell me why expand role does not wo

  • Field-symbols in classes

    Hello, Is it possible to use field-symbols in classes? When I try to declare field-symbol in class like other variable, appears an error. Or may be it is possible to use something instead of field-symbols? Great thanx in advance!

  • Captivate 6 video files not loading on share point 2013

    Hello, I use Adobe Captivate 6 and have courses that I'm loading to a share point site for learners to access. I worked off of my C: drive, then copied the published folders on a shared drive. I then linked the html URL to play the course. When the c

  • Can you put Chapter Header/Footer Sections in an iBook?

    I have spent an incredible amount of effort to find a way to display Title Chapter Headers / Title Chapter Footer (I have also tried doing it through css as well). I know on bottom of an ibook page you can tap on the brown scroller and it will displa