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
Which payment type is best if you are trying to stick to a budget?
nignag [31]

Answer:

debit card, credit cards usually make people overspend, and cash advance is a bad fee (like $10 minimum usually), and loans have interest

Explanation:

6 0
3 years ago
One reason to buy a home instead of rent a home is:
vazorg [7]
A is the correct Answer

7 0
3 years ago
What is the system that consists of nonproprietary hardware and software based on publicly known standards that allow third part
il63 [147K]

Answer:

Open systems

Explanation:

Open systems are very different from Open Source applications or software, it should not be confused.

Open systems work with the blend of open software standards, portability, and interoperability. Computer systems that interoperate among multiple standards and vendors to ensure that computer resources (hardware and software) are not allotted to a particular vendor. Such computer systems are considered as open systems.

For instance, computer systems that run a Microsoft Windows OS can be considered as an Open system. This is because of their capability to run different versions of the Microsoft Windows OS on that particular computer system. More clearly, A computer with Windows 10 OS, can be used to install Windows 8 OS without any issue. That same computer system can run the Windows 7 OS. This makes the computer system and open system.

5 0
2 years ago
Each column in an access table datasheet represents a ____.
kakasveta [241]
....field while a row represents a record
4 0
3 years ago
Your mothers date of birth and a unique personal identification number (pin) code provide authentication by _____.
Semenov [28]
Hello <span>Madysonhenders2477 </span><span>

Answer: Your mothers date of birth and a unique personal identification number (pin) code provide authentication by What you are (C)

Since your identification is about who you are, this would be the answer.

Hope This Helps!
-Chris</span>
6 0
3 years ago
Other questions:
  • Two or more computers that transfer information between computers are called a
    7·1 answer
  • 5. In Access, data is stored in a _______ once a form is completed. A. cell B. page C. record D. form
    13·1 answer
  • What are some examples of environmental technology
    8·1 answer
  • Select the correct answer. Which sentence best describe an effective management strategy? A. Conceal game-related clippings prio
    12·2 answers
  • Which of the following domain types is most trustworthy 1) .com 2) .tv 3).org 4) .edu
    15·2 answers
  • Which of the following is true about radio waves? They have short wavelengths. They have high energies. They reveal hot gases. T
    10·2 answers
  • Mary can view the thumbnails of her presentation slides when she’s creating the slides which element of the programs interface i
    8·1 answer
  • Computer simulations were first developed during __________<br> as a part of the _____________
    5·1 answer
  • How many 2/8 pound patties can she make from 7/8 of a pound of hamburger
    10·1 answer
  • ANSWER QUICKLY!!!
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!