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
postnew [5]
3 years ago
9

Write a full class definition for a class named Counter, and containing the following members:________

Computers and Technology
1 answer:
kipiarov [429]3 years ago
3 0

Answer:

The class definition for above problem in java is as follows:-

Explanation:

class Counter // class counter

{

  int counter; // variable counter

  Counter(int v) // construtor

  {

      counter=v;

  }

  void increment() //increment function

  {

      counter=counter+1;

  }

  void decrement() //decrement function

  {

      counter=counter-1;

  }

  int getValue() //getvalue function

  {

      return counter;

  }

}

Code Explanation:

  • The above class definition is in java language.
  • In this code, the name of the class is a Counter and it holds the three functions (increment, decrement and getvalue) and one constructor which is mentioned in the question.
  • To call the above class and their function firstly the user needs to create an object of the counter class in the main function by passing the one integer value on it.
  • The object declaration statement calls the constructor.
  • And then any function can be called by the object of the class with the help of the dot operator.
You might be interested in
Which of the following translates packets so that the node can understand them once they enter through a port?
zubka84 [21]

Answer:

The node translates on its own.

Explanation:

3 0
3 years ago
Read 2 more answers
What have been three technological changes to photography in the past 200 years?
kolbaska11 [484]
I hope this helps but cars, phones and computers.
3 0
3 years ago
Suppose the m2 money supply is $13 trillion, including: $7 trillion in savings accounts $3 trillion in checking accounts $1 tril
tia_tia [17]

Answer:

M1 is equal to $ 4 trillion

Explanation:

M1 money supplies are liquid money supplies like cash, checkable deposits, traveler's check etc. It is equal to;

M1= coins and currency in circulation + checkable (demand) deposit + traveler's check.

M2 money supply are less liquid and is equated as;

M2 = M1 + savings deposit + money market fund + certificates of deposit + other time deposits.

Savings = $7 trillion

Checkable deposit = $3 trillion

Money market fund = $1 trillion

Currency = $1 trillion

Certificates of deposit = $1 trillion

M1 = currency + checkable deposit

= $1 + $ 3

= $4 trillion.

6 0
2 years ago
Consider a set of mobile computing clients in a certain town who each
poizon [28]

Answer: answer given in the explanation

Explanation:

We have n clients and k-base stations, say each client has to be connected to a base station that is located at a distance say 'r'. now the base stations doesn't have allocation for more than L clients.

To begin, let us produce a network which consists of edges and vertex

Network (N) = (V,E)

where V = [S, cl-l, - - - -  cl-n, bs-l - - - - - - bs-k, t]

given that cl-l, - - - - - cl-n represents nodes for the clients

also we have that bs-l, - - - - - bs-k represents the nodes for base station

Also

E = [ (s, cl-i), (cl-i,bs-j), (bs-j,t)]

(s, cl-i) = have capacity for all cl-i (clients)

(cl-i,bs-j) = have capacity for all cl-i  clients & bs-j (stations)

⇒ using Fond Fulkorson algorithm we  find the max flow in N

⇒ connecting cl-i clients to  bs-j stations

      like (cl-i, bs-j) = 1

   if f(cl-i, bs-j)  = 0

⇒ say any connection were to produce a valid flow, then

if cl-i (clients) connected                f(s,cl-i) = 1 (o otherwise)

if cl-i (clients) connected  to bs-j(stations)   f(cl-i,bs-j) = 1 (o otherwise)

   f(bs-j,t) = no of clients  (cl-i)  connected to bs-j

⇒ on each node, the max flow value (f) is longer than the no of clients that can be connected.

⇒ create the connection between the client and base station i.e. cl-l to base bs-j iff    f(cl-i, bs-j) = 1

⇒ when considering the capacity, we see that any client cannot directly connect to the base stations, and also the base stations cannot handle more than L clients, that is because the load allocated to the base statsion is L.

from this, we say f is the max no of clients (cl-i) that can be connected if we find the max flow, we can thus connect the client to the base stations easily.

cheers i hope this helps

5 0
3 years ago
Which of the following is an example of an application software?
pishuonlain [190]
Word processing software
6 0
2 years ago
Other questions:
  • Brenda's working on improving a Google Search Ads quality score so it potentially gets a better ad rank and performs better in t
    9·1 answer
  • In this story, the reader is strongly encouraged to believe that Skidmore is guilty of poisoning his brother Manchester. Explain
    6·1 answer
  • In this part, you have to implement a linked list that maintains a list of integers in sorted order. Thus, if the list contains
    13·1 answer
  • Which of the following techniques would a Baroque composer most likely employ to evoke an affect of agitation? Select one:
    14·1 answer
  • Which one of the following items is an example of software?
    12·2 answers
  • Narrow margins are helpful for which task?
    6·1 answer
  • Does anyone know what to do when brainly won't let you answer questions? I click on answer question and then it just sits there
    15·2 answers
  • 6. You and your friends take an awesome selfie, and you add your name and addresses to the picture. It is a good idea to share t
    11·1 answer
  • Anyone else having problems with edg?
    9·1 answer
  • What do you mean by Graphics editing​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!