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
Select all that apply. Two physical things you can do to demonstrate you are paying attention to a speaker are _____ and _____.
omeli [17]
B and d ............
7 0
3 years ago
Read 2 more answers
Which transmission media is faster? Fibre Optic or Radio-waves? I want full explanation!
Bad White [126]

Answer:

Due to the direct line of sight,the data rate of radio links is higher than that of fiber optic connections. A radio link has a lower latency (less delay).In contrast ,fiber optic connections may achieve higher bandwidths

4 0
3 years ago
In computer Drag and Drop“ means to select the items, hold down the mouse and
kompoz [17]

Answer:

Release the mouse in the desired location.

5 0
3 years ago
Which of the following is a popular online forum?
Aliun [14]
4chan

it isn’t really commonly used anymore by the general population but it is a forum, whereas the other options aren’t forums.

for example, yelp is a review website and amazon is an online shopping site. buzzd is less known but i believe that it is a review website also.
3 0
3 years ago
Having knowledge of the main parts of a computer: CPU, ALU, INPUT, OUTPUT ,and MEMORY Can you explain in simple for dummies what
Morgarella [4.7K]

Answer:

Explanation:

Great question, it is important to ask these questions in order to get rid of any doubts you may be having.

I will explain this as simply as possible in separate parts.

CPU: the CPU is the brain of the computer where all the information is received, processed, and sent from.

ALU: are the digital circuits inside the CPU used to perform all the arithmetic and logic operations

INPUT: are the commands given to the computer by the user.

OUTPUT: is the information displayed on the screen by the computer.

Memory: is the piece of hardware used to save all the information that is currently being used by the computer.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
2 years ago
Other questions:
  • Hw to gain more knowledge ​
    6·1 answer
  • The Left Shift key is used to capitalize which keys?
    5·2 answers
  • Expressing your needs to others is aggressive behavior.<br> True or False?
    5·2 answers
  • What is the name of the symbol that is used to classify and categorize information?​
    10·2 answers
  • 22. A<br> allows one computer to input data into another computer.
    6·1 answer
  • Use the_____icon to insert a new record.<br><br> A. *<br> B. X<br> C. =<br> D. &amp;
    11·1 answer
  • Dynamic programming does not work if the subproblems: ___________
    5·1 answer
  • How will the health care professions be affected by all the computerized and technical advances concerning disabilities?
    9·1 answer
  • Which term best describes these lines?
    7·1 answer
  • 2 red and 2 overlapping balls in the center are surrounded by a green, fuzzy, circular cloud with a white line running through i
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!