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
Vlad [161]
3 years ago
7

Write a program that will add the content of two counters every 45 seconds and place the result in an integer register.

Computers and Technology
1 answer:
nexus9112 [7]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java and runs a thread every 45 seconds that adds the two counters together and saves them in an integer variable called register. Then prints the variable. If this code runs 5 times it automatically breaks the loop. This can be changed or removed by removing the breakLoopCounter variable.

 public static void add_Counters(int counterOne, int counterTwo) {

       int register = 0;

       int breakLoopCounter = 0;

       try {

           while (true) {

               register += counterOne + counterTwo;

               System.out.println(register);

               Thread.sleep(45000);

               breakLoopCounter += 1;

               if (breakLoopCounter == 5) {

                   break;

               }

           }

       } catch (InterruptedException e) {

           e.printStackTrace();

       }

   }

You might be interested in
Can you give me a long list of kid's cartoons
Delicious77 [7]
SpongeBob, Teen Titan Go, Future Worm. That's all I can think!
8 0
3 years ago
Read 2 more answers
Several students are making presentations for a science class. The chart describes the concept that each student will present to
Sedbober [7]

Question

Student presentation concepts from another source

Letitia - a step-by-step process of breaking down glucose into energy

Mana - repeating process of the steps of the cell division, going from interphase to division, and back to interphase.

Paul - a series of organisms that show similar characteristics and compare them to those that do not

Which best describes the SmartArt graphic layout each student should use?

Answer:

Letitia would use a process, Maria would use a cycle, and Paul would use a relationship.

Explanation:

Letita's assignment requires her to show how glucose can be broken down into energy, this requires a series of steps in s linear fashion, meaning it would be best suited to a process-style diagram.

Marta's project involves showing the steps of the cell cycle: the clue is in the name. This process is not linear, and instead repeats itself, meaning it fits to a cycle diagram (i.e. a circular diagram)

Paul is comparing and contrasting different organisms. Therefore, he should use a relationship diagram to show shared characteristics as well as features that differ.

4 0
3 years ago
The next elected president should be someone who can be very nice, kind, stick-up for him/herself, and take care of the people w
PSYCHO15rus [73]

Answer:trump

Explanation:

3 0
3 years ago
Read 2 more answers
What is one way polymorphism is implemented?
podryga [215]

Answer:

repurposing an operation

Explanation:

Got it right

8 0
3 years ago
A predecessor of a work processor is​
qwelly [4]

Answer: Printing of documents was initially accomplished using IBM Selectric typewriters modified for ASCII-character input. These were later replaced by application-specific daisy wheel printers, first developed by Diablo, which became a Xerox company, and later by Qume.

Explanation:

8 0
3 years ago
Other questions:
  • A broadband router is used to do which of the following? run the programs on a computer locate lost files on a computer manage a
    6·1 answer
  • Which type of graph or chart will you use to show changes in data points?
    5·1 answer
  • Write a method for the Customer class that that will return a string representing a bill notice when passed a double value repre
    14·1 answer
  • Its Inventiveness, uncertainty and futuristic ideas typically deals with science technology, what is it?
    7·2 answers
  • What happens if a computer lags too much?
    14·2 answers
  • The tag that describes the content of the web page is ________________
    5·1 answer
  • Hyperlink is a term used to refer to the specific manner of specifying the address of a website. Write reason for true or false.
    10·1 answer
  • ________(fill in the blank)in online education is intrinsically related to equity.
    13·1 answer
  • What type of access controls allow the owner of a file to grant other users access to it using an access control list
    5·1 answer
  • What does a companys code of ethics cover
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!