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
I figured out the secret message in Dad feels good, I can connect the dots
kati45 [8]

Answer:

Nope you figured it out

Explanation:

3 0
3 years ago
Question 8 OT TU
Semenov [28]
The qualities that are generally required are A. Vision
4 0
3 years ago
Give an example of how loops are used in programming Kturtle​
tankabanditka [31]

Answer:

Explanation:

KTurtle is an educational programming environment for turtle graphics. It is released under the open-source GNU General Public License and is part of the KDE Project since KDE3. KTurtle includes an IDE and a programming language which is loosely based on Logo and is intended for teaching programming.

5 0
3 years ago
How do media and networks interact?
bagirrra123 [75]

Answer:

The answer is C. Media are connected to networks that make information easier to  access and pass on.

Explanation:

Hope this helps you out! Please mark brainliest if it does! :D

4 0
3 years ago
A software development _____________ provides a framework for designing, writing, and testing software.
Ivenika [448]
I think methodology
4 0
3 years ago
Other questions:
  • What is meaning of reboot
    7·2 answers
  • 20 Points and Brainliest 5. What is the difference between a real-time light and a shadow map? Which of the two would you use if
    15·1 answer
  • Enables businesses and consumers to share data or use software applications directly from a remote server over the Internet or w
    6·1 answer
  • You want to change your cell phone plan and call the company to discuss options
    7·1 answer
  • A compound Boolean expression created with the _________ operator is true if either of its subexpressions is true.
    11·1 answer
  • What is a functional organisation? and how it functions​?
    12·1 answer
  • Which of these expressions is used to check whether number is equal to value?
    15·2 answers
  • For which input values will the following loop not correctly compute the maximum of the values? 1. Scanner in = new Scanner (Sys
    14·1 answer
  • Write a program that creates a two-dimensional array named height and stores the following data:
    15·2 answers
  • And this also please. help​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!