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

Answers

Answer 1

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();

       }

   }


Related Questions

In a three-tier architecture, the component that runs the program code and enforces the business processes is the:_______.

Answers

Answer:

Application Server

Explanation:

The Application Server is a component in computer engineering that presents the application logic layer in a three-tier architecture.

This functionality allows client components to connect with data resources and legacy applications.

In this process of interaction, the Application Server runs the program code from Tier 1 - Presentation, through Tier 2 - Business Logic to Tier 3 - Resources, by forcing through the business processes.

90 points can someone please write the code for this (HTML):


A text field to enter your name.

At least three multiple choice questions where only one answer can be chosen.

A word problem with a text area for the user to type in the answer.

At least three different math symbols using correct ampersand notation.

A Submit button at the end of the test.

Comment tags that indicate the start and end of the test.


I need to get this done really soon, please help. I couldn't find any text to HTML sites that included multiple choice and Interactive buttons.

Answers

Answer:

Explanation:

1.

First name:

Last name:

.

2.

What fraction of a day is 6 hours?

Choose 1 answer

6/24

6

1/3

1/6

Submit

</p><p> // The function evaluates the answer and displays result</p><p> function displayAnswer1() {</p><p> if (document.getElementById('option-11').checked) {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> }</p><p> if (document.getElementById('option-12').checked) {</p><p> document.getElementById('block-12').style.border = '3px solid red'</p><p> document.getElementById('result-12').style.color = 'red'</p><p> document.getElementById('result-12').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-13').checked) {</p><p> document.getElementById('block-13').style.border = '3px solid red'</p><p> document.getElementById('result-13').style.color = 'red'</p><p> document.getElementById('result-13').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-14').checked) {</p><p> document.getElementById('block-14').style.border = '3px solid red'</p><p> document.getElementById('result-14').style.color = 'red'</p><p> document.getElementById('result-14').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> }</p><p> // the functon displays the link to the correct answer</p><p> function showCorrectAnswer1() {</p><p> let showAnswer1 = document.createElement('p')</p><p> showAnswer1.innerHTML = 'Show Corrent Answer'</p><p> showAnswer1.style.position = 'relative'</p><p> showAnswer1.style.top = '-180px'</p><p> showAnswer1.style.fontSize = '1.75rem'</p><p> document.getElementById('showanswer1').appendChild(showAnswer1)</p><p> showAnswer1.addEventListener('click', () => {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> document.getElementById('showanswer1').removeChild(showAnswer1)</p><p> })</p><p> }</p><p>

3.<p> rows="5" cols="30"</p><p> placeholder="type text.">

4. <p>I will display &euro;</p>

<p>I will display &part;</p>

<p>I will display &exist;</p>

5. <input type="submit">

6. This code should be the first code

<!-- This is a comment -->

<p>Start Test.</p>

<!-- Remember to add more information here -->

This code should be the last and at the end of the of the html code

<!-- This is a comment -->

<p>End Test.</p>

<!-- Remember to add more information here -->

Notice: Answers may not be accurate and may be accurate. And pls endeavor to edit any part of the html code.

what is suitable equipment to meet customer needs from
1 stand alone pcs
2 networked pcs
3 servers
4 network equipment
5 operating system
6 application software

Answers

uh i think it’s uh carrot

Write a program to output the following quote by Edsger W. Dijkstra:

"Computer Science is no more about computers
than astronomy is about telescopes"
- Edsger W. Dijkstra
Hint: Remember that the escape characters \n and \" can be used to create new lines and quotation marks in your code.

Answers

In python 3.8:

print("\"Computer Science is no more about \ncomputers\nthan astronomy is about telescopes\"\n-Edsger W. Dijkstra")

I hope this helps!

Write a program that asks the user to input their first and last names. The first prompt should state:

Please input your first name:
The second prompt should state:

Please input your last name:
After accepting the inputs, your program should output the input in the form last name, first name.

Hint: Remember that you can concatenate (add) two phrases by using the + symbol. Don't forget that you'll need to add a comma as well and that the comma must be followed by a space.

Answers

first = input("Please input your first name: ")

last = input("Please input your last name: ")

print(last+", "+first)

I hope this helps!

What was the name of first computer?

Answers

The ENIAC (Electronic Numerical Integrator and Computer) was the first electronic programmable computer built in the U.S. Although the ENIAC was similar to the Colossus, it was much faster, more flexible, and it was Turing-complete.

What printer prints in different languages ​

Answers

Answer:

Printing in a different language

HP Deskjet 2630.Microsoft Windows 10 (32-bit)

Susan is taking a French class in college and has been asked to create a publication for her class. What feature can she
use to help her develop her publication in French?
Research
Grammar
Language
Spell Check

Answers

Answer:

Essayons

Explanation:

the answer is Language

Write an application named Hurricane that outputs a hurricane’s category based on the user’s input of the wind speed. Category 5 hurricanes have sustained winds of at least 157 miles per hour. The minimum sustained wind speeds for categories 4 through 1 are 130, 111, 96, and 74 miles per hour, respectively. Any storm with winds of less than 74 miles per hour is not a hurricane. If a storm falls into one of the hurricane categories, output This is a category # hurricane, with # replaced by the category number. If a storm is not a hurricane, output This is not a hurricane.

Answers

Answer:

def Hurricane(wind_speed):

   if wind_speed >= 157:

       print("Category 5 hurricane")

   elif wind_speed >= 130:

       print("Category 4 hurricane")

   elif wind_speed >= 111:

       print("Category 3 hurricane")

   elif wind_speed >= 96:

       print("Category 2 hurricane")

   elif wind_speed >= 74:

       print("Category 1 hurricane")

   else:

       print("Not a hurricane")

Hurricane(121)

Explanation:

The function "Hurricane" in the python code accepts only one argument which is the recorded speed of a hurricane. The nested if-statement evaluates the speed of the hurricane and output the appropriate category of the hurricane based on the speed.

Consider the use of 1000-bit frames on a 1-Mbps satellite channel with a 270-ms delay. What is the maximum link utilization for,
a. Stop-and-wait flow control?
b. Continuous flow control with a window size of 7?
c. Continuous flow control with a window size of 127?

Answers

i feel as if it would be B.

what are the types of slide show in powerpoint? define.​

Answers

Answer:

normal view

slide sorter view

master view

notes page view

Some of the latest smartphones claim that a user can work with two apps simultaneously. This would be an example of a unit that uses a __________ OS.

Answers

Answer:

MULTITASKING OS

Explanation:

MULTITASKING OPERATING SYSTEM is an operating system that enables and allow user of either a smartphone or computer to make use of more that one applications program at a time.

Example with MULTITASKING OPERATING SYSTEM smartphones user can easily browse the internet with two applications program like chrome and Firefox at a time or simultaneously

Therefore a user working with two apps simultaneously is an example of a unit that uses a MULTITASKING OS.

Claire wants to be a digital media coordinator. What requirements does she need to fulfill in order to pursue this career?

To be a digital media coordinator, Claire needs a bachelor’s degree in _______ digital media, or a related field. She also needs to have knowledge of _______ and emerging digital technologies.

1st blank:
psychology
public relations
finance

2nd blank:
computer programming
computer coding
search engine optimization

Answers

Answer:

1. Public Relations

2. Search Engine Optimization

Explanation:

Given that a public relations degree holder can work in various capacities such as Advertising, Media, Event, and Sale promotion position. Hence Claire needs a bachelor’s degree in PUBLIC RELATIONS.

Similarly, given that the knowledge of Search Engine Optimization is crucial in Digital media coordination, as it helps to drive and gain web or online traffic both in quality and quantity.

Hence, Claire also needs to know about Search Engine Optimization.

Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element. Ex: lowerScores = {5, 0, 2, -3} becomes {4, 0, 1, 0}.Sample program:#include using namespace std;int main() { const int SCORES_SIZE = 4; vector lowerScores(SCORES_SIZE); int i = 0; lowerScores.at(0) = 5; lowerScores.at(1) = 0; lowerScores.at(2) = 2; lowerScores.at(3) = -3; for (i = 0; i < SCORES_SIZE; ++i) { cout << lowerScores.at(i) << " "; } cout << endl; return 0;}Below, do not type an entire program. Only type the portion indicated by the above instructions (and if a sample program is shown above, only type the portion.)

Answers

Answer:

Replace <STUDENT CODE> with

for (i = 0; i < SCORES_SIZE; ++i) {

       if(lowerScores.at(i)<=0){

           lowerScores.at(i) = 0;

       }

       else{

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Explanation:

To do this, we simply iterate through the vector.

For each item in the vector, we run a check if it is less than 1 (i.e. 0 or negative).

If yes, the vector item is set to 0

If otherwise, 1 is subtracted from that vector item

This line iterates through the vector

for (i = 0; i < SCORES_SIZE; ++i) {

This checks if vector item is less than 1

       if(lowerScores.at(i)<1){

If yes, the vector item is set to 0

           lowerScores.at(i) = 0;

       }

       else{

If otherwise, 1 is subtracted from the vector item

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Also, include the following at the beginning of the program:

#include <vector>

what will be output of this program a. less than 10 b. less than 20 c. less than 30 d. 30 or more

Answers

Answer:

D. 30 or more

Explanation:

The score value is passed in as var, meaning, its value could change. In this instance score started at zero and 30 was added to it. The last condition is the only condition that fits score's value(if that makes sense). So its in fact D.

hope i was able to help ;)

The TCP/IP Application Layer and the OSI Application Layer are relevant mainly to programmers, not to network technicians.

True/False

Answers

Answer:

Yes they are to programmer

Explanation:

Plz give me brainiest

Answer:

true

Explanation:

The CEO, calls you into her office and tells you that she's learned that the company needs a database to keep track of supplier contact data as well as the experiences that buyers and operations personnel have with the suppliers. She asks you to begin developing this database. What is your first step in developing the database?

Answers

the database has been a very unique way to park in

What does cpu mean ​

Answers

Answer:

CPU or Central processing unit is the principal part of any digital computer system, generally composed of the main memory, control unit, and arithmetic-logic unit.

Hope this helps and if you could mark this as brainliest. Thanks!

Comment on the following 2 arrays. int *a1[8]; int *(a2[8]); a1 is pointer to an array; a2 is array of pointers a1 is pointer to an array; a2 is pointer to an array a1 is array of pointers; a2 is pointer to an array a1 is array of pointers; a2 is array of pointers

Answers

Answer:

The answer is "a1 and a2 is an array of pointers".

Explanation:

In this question, A collection of pointers refers to an array of elements where each pointer array element points to a data array element. In the above-given statement, the two-pointer type array "a1 and a2" is declared that holds the same size "8" elements in the array, and each element points towards the array's first element of the array, therefore, both a1 and a2 are pointer arrays.

Need help with 4.7 lesson practice

Answers

Answer:

1.a

2.sorry cant read it that wekk

3.c

Explanation:

Write a function named cube that accepts a number as an argument and returns the cube of that number. Write Python statement(s) that passes 3 to this function and prints returned value.​

Answers

def cube(num):

   return num*num*num

for the number 3:

def cube():

    return 3*3*3

For risk monitoring, what are some techniques or tools you can implement in each of the seven domains of a typical IT infrastructure to help mitigate risk

Answers

Answer:

 a. User Domain: Create awareness for acceptable user-policies and security risk to educate employees of pending risk.

b. Workstation Domain: Install anti-virus and constantly update the system software.

c. LAN Domain:  Access control list or ACL should be configured in routers and port security in switches to avoid hackers physically connecting to the network.

d. LAN-to-WAN Domain: Configure firewalls and intrusion detection and prevention protocols to mitigate unwanted access.

e. WAN Domain: Configure demilitarized or demarcation zone to provide secure access and prevent unwanted users from accessing network information.

f. Remote Access Domain: The use of VPNs to grant remote access to users or employees working from home and internet protocol security (IPsec) to encrypt the packet transmission.

g. Systems/Applications Domain: Administration should be well trained and ensure to get security software patches from appropriate vendors and testing them before use.

Explanation:

Risk monitoring is one of the IT infrastructure risks management plan that observes and analyzes the threats of risk in an IT infrastructure.

3. Answer the following questions.
a. How does computer number system play
calculations?
a vital role in a
computer​

Answers

Answer:

Computers use the binary number system to store data and perform calculations.

Explanation:

PLS HELP I WILL MARK BRAINLIEST

Answers

Answer:B

Explanation: its the nucules

The answer most likely is B

write an essay about yourself based on the dimensions of ones personality​

Answers

I don’t think that we can answer this question, since it’s based on yourself.

Most operating systems perform these tasks. coordinating the interaction between hardware and software allocating RAM to open programs creating and maintaining the FAT modifying word processing documents correcting spreadsheet formulas displaying the GUI

Answers

Answer:

The answer are A.) Coordinating the interaction between hardware and software And B.) Allocating RAM to open programs

Explanation:

Hope this helps :)

Tasks that are been performed by most operating systems are;

Coordinating the interaction between hardware and software.Allocating RAM to open programs.

An operating system can be regarded as system software which helps in running of computer hardware as well as software resources and mange them.

This system provides common services for computer programs.

It should be noted that  operating system coordinating the interaction between hardware as well software.

Therefore, operating system, allocate RAM to open programs.

Learn more about operating system at:

https://brainly.com/question/14408927

In a program a menu shows a list of?

Answers

Answer:

implemented instructions

4.2 Lesson Practice​

Answers

Answer:

5 and 10

Explanation:

Terminology used to describe the interaction between a computer program and its user is input and output. Input refers to what the user provides to the program, whilst Output refers to what the software provides to the user.

What is the role of output in program?

The term “output” describes how data is shown, whether it's on a screen, a printer, or in a file. Data display to the computer screen and data storage in text or binary files are both supported by a set of built-in C programming functions.

It may be argued that output is equally crucial to language development as intake. (The term “output” refers to the written and spoken language that the learner creates.) Teachers should therefore encourage their pupils to attempt using the language they are learning as frequently as they can.

Therefore, The capacity to extract a certain form or structure and string those forms and structures together to represent a specific meaning is known as output.

Learn more about output here:

https://brainly.com/question/18079696

#SPJ5

Java Eclipse homework. I need help coding this

Challenge 14A - BaseConverter

Package: chall14A
Class: BaseConverter

Task: Create a program that takes user input as a decimal and converts it to either an octal, binary, or hexadecimal base:

1. Show a title on the screen for the program.
2. Ask the user if they want to run the program.
3. Create a menu for the user to choose the base to convert to.
4. Take decimal (base10) from user and print out the number in the new base.

Answers

import java.util.Scanner;

public class BaseConvertor {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Welcome to Base Convertor! This program will convert numbers into different bases of your choosing.");

       System.out.print("Do you still want to run the program? ");

       String ans = scan.next();

       if (ans.toLowerCase().equals("yes")){

           System.out.println("1. Octal");

           System.out.println("2. Binary");

           System.out.println("3. Hexadecimal");

           System.out.print("Type the number of the base you want to conver to: ");

           int base = scan.nextInt();

           System.out.print("Enter your number: ");

           int num = scan.nextInt();

           if (base == 1){

               

               String newNum = Integer.toOctalString(num);

               System.out.println(num+" in Octal is "+newNum);

           }

           else if (base == 2){

               String newNum = Integer.toBinaryString(num);

               System.out.println(num+" in Binary is "+newNum);

           }

           else if (base == 3){

               String newNum = Integer.toHexString(num);

               System.out.println(num+" in Hexadecimal is "+newNum);

           }

                   

       }

       else{

           System.out.println("Have a good day!");

       }

   }

   

}

I hope this helps!

hey yall wanna send me some just ask for my phone #

Answers

Answer:

Send you some what?

Explanation:

the answer is 12

Other Questions
Which is an example of personification?A. adding the "person" ending to a sign to indicate that it is a professionB. fingerspelling a proper noun like a last nameC. relying on speechreading when first conversing with a new ASL-speaking friendD. introducing yourself as a linguistic minority Explain 4 disadvantages of state owned entreprises what is the specific goal of product promotion ? Sheila picks for 1 1/4 pounds of blueberries for $10 how many pounds can she pick for $1 a community hospital in pennsylvania has a 15% supply expense ratio. If total operating expenses are $1 million this month, what is the total annual cost of supplies what is any of these questions dont worry bout the others Does anyone have an answer for this??? What is one criterion for a crime to be classified as a federal offense?The crime originated before the Constitution was ratified.The person committing the crime was born within the borders of the District of Columbia.The value of the items taken or destroyed in the crime exceeds $250.The person committing the crime crossed one or more state borders during the commission of the crime. 3 < y 7 where y is an integer Write down all the possible values of y Complete the following sentences with the present tense of the verb VIVIR A bulldozer pushes on a boulder with a force of 600 N. It accelerates at 3 m/s. Find mass. What is meant by the word "concentration"'? What is the equation of this graphed line?Enter your answer in slope-intercept form.Please answer quickly, I will give brainliest to whoever answers correctly, thank you. please helpp mecwith this question The lightness or darkness of a color/hueA.ShadeB.ToneC.TintD.Value The atomic of nitrogen is 7. The number of electrons a neutral atom has is_, and its atomic mass is approximately_amu. Umm I know that I shouldnt be using Brainly for this but can somebody tell me what im supposed to put for the Applications in my Science fair project cuz im confused and Google doesnt help me so yeah please tell me im confused A $5,000 face value bond has a coupon rate of 6.5%, sells for $5,937, and matures in 7 years. What is its yield to maturity?a. 3.44%.b. 5.47%.c. 6.12%.d. 4.08%. Vice President Dickk Cheney was called upon to temporarily assume the office of president when __________.A.President Bush was on vacation at Camp DavidB.he was sent on diplomatic missions in the Middle EastC.President Bush attended his impeachment hearings in joint sessions of CongressD.President Bush, on two occasions, had to undergo surgical procedures What is an ion pump??