1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DIA [1.3K]
3 years ago
7

Write a class named grocerylist that represents a list of items to buy from the market. write another class called item that rep

resents a request to purchase a particular item in a given quantity (for example four boxes of cookies). the grocerylist class should use an array field to store items and to keep track of its size (number of the items in the list so far). assume that a grocery list will have no more than 50 items.
Computers and Technology
1 answer:
nataly862011 [7]3 years ago
5 0
Class Item {
// item class attributes
string itemName;
int itemQuantity;
double itemPrice;
...
}

class grocerylist {

// you can use arrays or any other containers like ArrayList, Vectors,...etc depends on programming language you use

Item[50] itemList;
int size;
public grocerylist () {
this.size = 0;
}
public void addItem(Item i) {
itemList[size] = i;
size = size +1;                      // Or size++
}
}
You might be interested in
Write the icon of full justification​
ad-work [718]

Answer:

In the paragraph group, click the Dialog box Launcher. ,and select the Alignment drop - down menu to set your justified text. You can also use the keyboard shortcut , Ctrl + J to justify your text

6 0
2 years ago
How to play music out of your apple watch?
Travka [436]
It does not work that way....I thought the same thing. The sound will always come out of your iPhone
6 0
4 years ago
What does it mean to have liability for a company?
astraxan [27]

you can get tax identification number, open a bank account and do business all under its own name


3 0
3 years ago
A _____ is a predefined text format that includes multiple formatting options.
VladimirAG [237]
A style is a predefined text format that includes multiple formatting options.
7 0
3 years ago
What is the full form of html​
zepelin [54]

Answer:

Hypertext Markup Language

Explanation:

Hypertext Markup Language

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is something that scientists often seek by using computer models and simulations?
    8·2 answers
  • True or false: Your digital footprint is all the information about you online that only you post. Group of answer choices
    12·2 answers
  • In which phase of the software development process would probing questions be used to verify the problem definition?
    12·1 answer
  • What is the term used for a set of programs that acts as an interface between the applications that are running on a computer an
    13·1 answer
  • Can i edit my name on this app?
    7·1 answer
  • As a general rule, the number of bullet points on a slide should not exceed _____. a.2 b.4 c.8 d.10
    9·1 answer
  • Given the following array definition, write a constant declaration named ArraySize that automatically calculates the size in byt
    5·1 answer
  • WILL MARK BRAINLIEST!!!!!!!!!!!
    6·2 answers
  • Employing the use of a(n) <br> will help you manage a STEM project.
    13·1 answer
  • Please help me asapppp!​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!