answer.
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
MAXImum [283]
2 years ago
6

Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 100 milliseconds

. Call clearInterval() to cancel the interval when the count displays 4.
Computers and Technology
1 answer:
GrogVix [38]2 years ago
6 0

Answer:

var count = 0;

var counterElement = document.getElementById("counter");

counterElement.innerHTML = count;

var interval = setInterval(function () {

   count++;

   counterElement.innerHTML = count;

   if (count === 4) {

       clearTimeout(interval);

   }

}, 100);

Explanation:

You might be interested in
What does NOT match with Agile Manifesto?
Butoxors [25]

Answer:

yes

Explanation:

7 0
2 years ago
Given 4 integers, output their product and their average, using integer arithmetic.
solmaris [256]

Answer:

see explaination

Explanation:

Part 1:

import java.util.Scanner;

public class LabProgram {

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int num1;

int num2;

int num3;

int num4;

int avg=0, pro=1;

num1 = scnr.nextInt();

num2 = scnr.nextInt();

num3 = scnr.nextInt();

num4 = scnr.nextInt();

avg = (num1+num2+num3+num4)/4;

pro = num1*num2*num3*num4;

System.out.println(pro+" "+avg);

}

}

------------------------------------------------------------------

Part 2:

import java.util.Scanner;

public class LabProgram {

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int num1;

int num2;

int num3;

int num4;

double avg=0, pro=1; //using double to store floating point numbers.

num1 = scnr.nextInt();

num2 = scnr.nextInt();

num3 = scnr.nextInt();

num4 = scnr.nextInt();

avg = (num1+num2+num3+num4)/4.0; //if avg is declared as a float, then use 4.0f

pro = num1*num2*num3*num4;

System.out.println((int)pro+" "+(int)avg); //using type conversion only integer part

System.out.printf("%.3f %.3f\n",pro,avg);// \n is for newline

}

}

8 0
2 years ago
Write a method that accepts a String object as an argument and displays its contents backward. For instance, if the string argum
Nata [24]

Answer:

// importing the necessary libraries

import java.util.Scanner;

public class BackwardString {

public static void main(String[] args) {

String input;

// Scanner object to read string from user input

Scanner scanner = new Scanner(System.in);

System.out.print("Enter String here : ");

input=scanner.next();

// calling backward method to reverse passed string

backward(input);

// closing Scanner object

scanner.close();

}

// Method to Reverse the input string

private static void backward(String source) {

int i, len = source.length();

StringBuilder dest = new StringBuilder(len);

for (i = (len - 1); i >= 0; i--){

dest.append(source.charAt(i));

}

System.out.println("Reversed String : "+dest);

}

}

Explanation:

// importing the necessary libraries

import java.util.Scanner;

public class BackwardString {

public static void main(String[] args) {

String input;

// Scanner object to read string from user input

Scanner scanner = new Scanner(System.in);

System.out.print("Enter String here : ");

input=scanner.next();

// calling backward method to reverse passed string

backward(input);

// closing Scanner object

scanner.close();

}

// Method to Reverse the input string

private static void backward(String source) {

int i, len = source.length();

StringBuilder dest = new StringBuilder(len);

for (i = (len - 1); i >= 0; i--){

dest.append(source.charAt(i));

}

System.out.println("Reversed String : "+dest);

}

}

The program above accepts a String object as an argument and displays its contents backward.

It reverses the any string inputed while producing the output.

6 0
2 years ago
ACCOUNTING
ivann1987 [24]

last question is D

Hope this helps

7 0
2 years ago
Read 2 more answers
Computer programmers often use binary codes (strings of 1s and 0s) to write programs for computers. These codes are then changed
PilotLPTM [1.2K]

Answer:

Bottom Up Processing.

Explanation:

Bottom-up processing relates to how sensory information is interpreted as it comes in.  When I flash a generic picture on the monitor, the features will be identified by your eyes, your brain will put it together and you will interpret an eagle image.  

Bottom-up refers to how it is assembled from the tiniest pieces of sensory data.In the bottom-up processing when the codes are changed into the patterns that the computer recognizes as words, pictures, etc

7 0
2 years ago
Other questions:
  • Gloria needs to show in spreadsheet form the number of students in her class who speak different languages. Which type of graph
    7·1 answer
  • The piston engine uses the ________ to convert the reciprocating motion of the piston into rotary motion.
    13·1 answer
  • An electronics store purchased a CD player at a wholesale price of $60 and then sold it at a 40 percent discount off the origina
    13·1 answer
  • A network design engineer has been asked to design the IP addressing scheme for a customer network. The network will use IP addr
    6·1 answer
  • When trying to improve performance of a slow system, you notice in Task Manager that the superfetch service is using a high perc
    11·1 answer
  • In step 4 of the CSMA/CA protocol, a station that successfully transmits a frame begins the CSMA/CA protocol for a second frame
    9·1 answer
  • Which of the following should get a Page Quality (PQ) rating of Low or Lowest? Select all that apply. True False A page with a m
    8·1 answer
  • PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
    6·1 answer
  • A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi
    15·1 answer
  • A large offshore oil platform needs to transmit signals between different devices on the platform with high reliability and low
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!