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
Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)
Mnenie [13.5K]

Answer:

(1)Minterms complement = XYZ (2) Compliment of Minterms = Σm(0,1, 2 , 4 , 6) (3) (X+Y+Z) (4) Minimized SOP = Z + XY

Manterms = πM

Explanation:

Solution

Recall that:

Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)

(1) Canonical Disjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as minterms

In Minterm we assign 'I' to each uncomplimented variable and '0' to each complemented/complementary variable

For the given question stated we ave the following:

Minterms = XYZ, XYZ, XYZ, XYZ, XYZ.

(2) Canonical Conjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as maxterms.

In Maxterms we assign '0' to each uncomplimented variable and '1' to each complemented/complementary variable

Compliment of Minterms = Σm(0,1, 2 , 4 , 6)

Maxterms = πM

Note: Kindly find an attached copy of the complete solution to this question below.

6 0
3 years ago
5. What are some situations where you might find it useful to use the “!” symbol in a program?
svlad2 [7]

Answer:

The most common use of symbols by programmers is for performing language reflection (particularly for callbacks), and most common indirectly is their use to create object linkages. In the most trivial implementation, they have essentially named integers (e.g. the enumerated type in C).
<u>Help Me By Marking Me as Brainlist ...</u>

5 0
2 years ago
Read 2 more answers
What is a network of high-capacity communication links is the internet?
mojhsa [17]

Social media is the high capacity of communication links

5 0
3 years ago
Instance variables are declared private to prevent direct modification. Access to the variables is instead provided through meth
yuradex [85]
<span>Instance variables are declared private to prevent direct modification. Access to the variables is instead provided through methods. This practice is known as.. 
</span><span>c. encapsulation.  It </span><span>is a mechanism of bundling the data (variables) and code acting on the data (methods) together as one.</span>
7 0
3 years ago
When recording a song on her laptop, Sarah noticed a slight delay in what she could hear on her headphone and what she was recor
PolarNik [594]

Answer:

latency

Explanation:

We could have latency if we want to record with a computer, and then we try to hear that record with the headphone.

This is an audio card's characteristic, this is a time between the input, in this case, Sarah recording, and the output Sarah's headphone.

The computer needs time to process the signal, and for that there is latency, but this depends on more of the operative system and the CPU in your computer than the audio card.

6 0
4 years ago
Other questions:
  • The following declaration appears in a program: short totalPay, basePay = 500, bonus = 1000; The following statement appears in
    9·1 answer
  • --------------------is a host that runs software to provide information, such as web content, to other hosts.
    9·1 answer
  • i got a set of headphones and when i plug them into my speakers the right side only works how do i fix the left side of them
    12·1 answer
  • What is microsoft certification?
    8·1 answer
  • The printer prints 16 pages every minute. How many pages are printed in 6 minutes?
    14·2 answers
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • Ashley works for a company that helps hospitals hire new doctors. They have written a list of strategies that can be used to int
    12·1 answer
  • In java I need help on this specific code for this lab.
    5·1 answer
  • All Office programs have similar commands on the tab for changing the document view a. File b. View c. Locate d. display ​
    5·1 answer
  • You will need to convert the following binary numbers to hexadecimal. Table 1 contains 16 problems. The first one is completed f
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!