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
First let 2161965 answer<br> and then you ..
NARA [144]

Answer:

then you???

Explanation:

i think you're forgetting something (like you're pfp)

7 0
3 years ago
Read 2 more answers
Drag each connector name to match the connector type shown.
Setler79 [48]

Answer:

The first one is usb-c, the second is mini-usb, the third is micro-usb.

Explanation:

8 0
2 years ago
Qbasic program to accept 10 numbers and to find their sum. <br>​
sesenic [268]

Answer:

the answer is 5

Explanation:

6 0
3 years ago
What is distribution hardware?
saveliy_v [14]
A distributed computer system consists of multiple software components that are on multiple computers, but run as a single system. The computers that are in a distributed system can be physically close together and connected by a local network, or they can be geographically distant and connected by a wide area network.
4 0
3 years ago
Ark titanoboa taming
ivann1987 [24]
Huh???????................
3 0
3 years ago
Other questions:
  • Write an expression to print each price in stock_prices. sample output for the given program: $ 34.62 $ 76.30 $ 85.05
    6·1 answer
  • What type of document would you use the landscape page orientation
    7·1 answer
  • What information medium is used to access information from the Internet in the form of HTML pages?
    12·1 answer
  • In a Java Script language. create a two-dimension array consisting of numbers representing costs. After creating the array, prin
    11·1 answer
  • E-mail messages, instant messages (IMs), or text messages sent and/or received within an organization a. are not included on a r
    9·1 answer
  • An ip address in the address range 169.254.x.y, used by a computer when it cannot successfully lease an ip address from a dhcp s
    6·1 answer
  • I need help fixing this please
    6·2 answers
  • Explain two ways by which the calendar meets or fails to meet the criteria of showing the correct data
    7·1 answer
  • PLEASE HELP How have phones made us spoiled? How have phones made us unhappy?
    10·1 answer
  • Paisa pay is facilitated in which e commerce website​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!