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
malfutka [58]
3 years ago
8

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

mit of type int. A constructor that takes two int arguments and assigns the first one to counter and the second one to limit 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. It also does not 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.
Computers and Technology
1 answer:
Usimov [2.4K]3 years ago
6 0

Answer:

Class Counter

{

   public Int counter;

   public Int limit;

   public void increment()

   {

     If( counter<limit)

      {

        counter++;

      }

   }

   public void decrement()

   {

      if (counter>limit)

      {

        counter--;

      }

   }

   public getvalue()

   {

     cout<<"Counter Value is:"<<counter;

   }

}

Explanation:

Class Counter

{

   public Int counter;

   public Int limit;

   public void increment()

   {

     If( counter<limit)

      {

        counter++;

      }

   }

   public void decrement()

   {

      if (counter>limit)

      {

        counter--;

      }

   }

   public getvalue()

   {

     cout<<"Counter Value is:"<<counter;

   }

}

You might be interested in
What term is used to describe the process of monitoring operating results and comparing actual results with the expected results
s344n2d4d5 [400]

Answer:

controlling

Explanation:

hope this helps

7 0
3 years ago
Help me right now!!!!!!!!!!!!!!!!!!!!!!!!11
PilotLPTM [1.2K]
Word-processing software includes basic applications designed for casual business or home users and powerful, advanced applications capable of meeting the most-demanding needs of businesses. Many word-processing applications are designed for use as part of a suite or integrated group of word-processing, spreadsheet, and presentation programs
4 0
3 years ago
un diagrama de flujo donde se gana una partida de ajedrez teniendo en cuenta los movimientos de la otra persona
mash [69]
Estoy tan confundido. ? estas haciendo una pregunta?

7 0
4 years ago
A byte in memory is identified by a unique number called its
Murrr4er [49]
It is identified by its address number.
4 0
4 years ago
Why is it important to register your software when you install it
Serjik [45]

the normal reasons program creators deliver to enroll your program – to get tech bolster, news, upgrades, offers, bug fixes, and so on. It too ensures your venture since it gives you changeless get to to your enlisted serial number in case something ever happens to your computer or computer program.

6 0
3 years ago
Other questions:
  • What kind of firewall can block designated types of traffic based on application data contained within packets?
    7·1 answer
  • a.Write a Python function sum_1k(M) that returns the sumí‘ í‘ = ∑1푘푘푀푀푘푘=1b.Compute s for M = 3 by hand and write
    15·1 answer
  • The cold war actually helped in the development of the internet true or false
    8·1 answer
  • Provide the instruction type, assembly language instruction, and binary representation of instruction described by the following
    7·1 answer
  • How has music changed with the use of technology?
    14·1 answer
  • Choose the best answer from the drop-down menu. A ______ allows multiple connections to a single signal. Without a ______, conne
    7·2 answers
  • Lily obtained data from five trails 50 kcal 72 kcal 12 kcal and 50 kcal which best decribes her data
    11·1 answer
  • What are three ways a person may use a computer without realizing it?
    9·1 answer
  • 4. Contoso, Ltd. has a vigorous Office 365 and Azure cloud-service presence.
    8·1 answer
  • Data becomes _______ when it is presented in a format that people can understand and use.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!