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
Ad libitum [116K]
3 years ago
14

Write the definition of a class Counter containing: An instance variable named counter of type int. An instance variable named l

imit of type int. A static int variable named nCounters which is initialized to 0. A constructor taking two int parameters that assigns the first one to counter and the second one to limit. It also adds one to the static variable nCounters. A method named increment. It does not take parameters or return a value; if the instance variable counter is less than limit, increment just adds one to the instance variable counter. A method named decrement that also doesn't take parameters or return a value; if counter is greater than zero, it just subtracts one from the counter. A method named getValue that returns the value of the instance variable counter. A static method named getNCounters that returns the value of the static variable nCounters.
Computers and Technology
1 answer:
viktelen [127]3 years ago
5 0

Answer:

see explaination

Explanation:

public class Counter

{ int counter,limit;

static int nCounters = 0;

Counter(int a,int b)

{ counter=a; limit=b;

nCounters++;

}

void increment()

{ if(counter<limit)

counter++;

}

void decrement()

{ if(counter>0)

counter--;

}

private int getValue()

{ return counter;

}

private static int getNCounters()

{ return nCounters;

}

}

You might be interested in
What are the different between Facebook and LinkedIn
DIA [1.3K]
Face you can talk to friends post picture's and see pictures of friends i am not really sure what is linkedln
7 0
3 years ago
Read 2 more answers
Blair is the director of information systems at a marketing firm. She creates a set of guidelines that dictate everything an emp
gizmo_the_mogwai [7]

Answer:

data

Explanation:

Because i said so

4 0
3 years ago
4. An abstract data type is defined as _____.
marusya05 [52]

Answer: object that persist set of values and operations as behavior

Explanation: Abstract data types(ADT)are those object value which are dependent upon the collection of the values and collection of the operations.The organization of the data object is not specified in ADT but the operations that are to be carried out are defined in it.

The implementation individuality displayed by the ADT and hiding of the representation or design makes it abstract.

8 0
3 years ago
Which of these statements about the truck driving occupation in the U.S. are accurate?
Airida [17]

Answer:

I'm unsure 38373672823

8 0
2 years ago
Read 2 more answers
A(n) ________ is usually a live broadcast of audio or video content. Select one: A. instant message B. webcast C. podcast D. wik
navik [9.2K]

Answer: B webcast

Explanation:

A webcast is a technology that allows the live broadcast of an audio or video event on the Internet. It is also known as Web lecture, virtual meeting, etc. The major advantage is that it gives room for an event to have a larger reach. Webcast participation can be through PC, smart phones, tablets and other devices with quality Internet access.

7 0
3 years ago
Read 2 more answers
Other questions:
  • considering that two variables counters and accumulators are important in loop design. What would be their purpose?
    9·1 answer
  • Billy used to take care of his laptop. However, one day he lost his laptop. He lost all his data, and there was no way to retrie
    10·2 answers
  • Having a conversation with someone using a cellular phone is an example of _________ transmission. simplex full-duplex half-dupl
    11·1 answer
  • What is the radix transformation method?
    5·1 answer
  • The way a program is proceed is know as control flow and are :Sequence(one line after the other), Decision-making(either this or
    8·1 answer
  • NEED FIVE QUESTIONS ANSWERED!!!
    7·1 answer
  • Select the correct answer.
    7·2 answers
  • Difference between if then and if then else statement ​
    14·1 answer
  • 4. In Drag and Drop method of Excel , to copy the data , you need to press __________ key while dragging the cells.
    7·1 answer
  • What is assembler? What is Compiler?What is interpreter?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!