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
Rudiy27
3 years ago
11

Whats wrong with my code for .addEventListener

Computers and Technology
1 answer:
Kobotan [32]3 years ago
4 0

Answer:

Java code that is what I think

You might be interested in
Audrey would like to save her document. She should choose the Save command from the _____. folder menu window directory
Damm [24]

Answer:

File folder

Explanation:

6 0
3 years ago
Text that is positioned at the top of a column and labels the<br> column.
Vanyuwa [196]

Answer:

column header

Explanation:

3 0
3 years ago
1. Atestharnessprogramfortestingsortingmethodsisprovidedwiththeprogram iles.ItisintheileSorts.javainthech11.sortspackage.Theprog
tiny-mole [99]

Answer:

Following are the code to this question:

//import package

import java.util.*;

import java.text.*;

public class Main//defining a class

{

static final int t = 50;//defining an integer constant variable

static int[] ele = new int[t];//defining an array

static int tS = 0;//defining integer variable

static void initelements()//defining a static method

{

Random r= new Random();//creating Random class Object

for (int i = 0; i < t; i++)//use loop to add value in array

ele[i] = Math.abs(r.nextInt()) % 100;//add value in array

}

static public boolean isSorted()//defining a method isSorted

{

boolean x = true;//defining boolean variable

for (int i = 0; i < (t - 1); i++)//use for loop to count array values

if (ele[i] > ele[i + 1])//use if to compare array values

x = false;//use boolean variable to hold false value

return x;//return boolean value

}

static public void swap(int x1, int x2)//defining swap method

{

tS++;//increment variable value by 1

//performing swapping

int te = ele[x1];//defining te variable that holds array values

ele[x1] = ele[x2];//exchanging array values

ele[x2] = te;//holding te values

}

static public void disp()//defining a method disp

{

int v1;

DecimalFormat f = new DecimalFormat("00");//creating DecimalFormat class Object

System.out.println("The elements array is:");//print message

for (int i = 0; i <t; i++)//defining for loop  

{

v1 = ele[i];//holding array value in v1 variable

if (((i + 1) % 10) == 0)//use if to check i value

System.out.println(f.format(v1));//print value

else//else block

System.out.print(f.format(v1) + " ");//print value

}

System.out.println();//print space

}

static int getMinimum(int st, int en)//defining a method getMinimum

{

int iMi = st;//defining variable that holds parameter value

for (int i = st + 1; i <= en; i++)//use for loop compare array value

if (ele[i] < ele[iMi])//compare array value

iMi = i;//use iMi to hold loop value

return iMi;//return iMi value

}

static void selectionSort()//defining a selectionSort method

{

int e = t - 1;//defining e variable that holds total array count value

for (int i = 0; i < e; i++)//use for loop to call swap method  

swap(i, getMinimum(i, e));//calling the swap method

}

public static void main(String[] args)//defining main method  

{

initelements();//calling initelements method

disp();//calling disp method

System.out.println("elements is sorted: " + isSorted());//calling is isSorted method with the message

System.out.println();//for space

selectionSort();//calling selectionSort method

System.out.println("No of swaps :" + tS);//print totalswap value with the message

disp();//calling disp method

System.out.println("elements is sorted: " + isSorted());//calling is isSorted method with the message

System.out.println();//for space

}

}

Output:

Please find the attached file.

Explanation:

In this code inside the Main class, 5 static methods "initelements, isSorted, swap, disp, getMinimum and selectionSort" is declared, in which the first method holds random values in arrays, in second array it sorts its values, in the third method it swap the array, in the disp method it shows array values.

In the "getMinimum and selectionSort"  it sorts array values and inside the main method, it calls all methods and prints their values.

3 0
3 years ago
In Qbasic how I type the diference between two numbers?
zavuch27 [327]

Answer:

REM PROGRAM TO DISPLAY SUM OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

S = A + B

PRINT “SUM OF TWO NUMBERS”; S

END

USING SUB PROCEDURE

DECLARE SUB SUM (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL SUM(A, B)

END

SUB SUM (A, B)

S = A + B

PRINT “SUM OF TWO NUMBERS”; S

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION SUM (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

S = SUM(A, B)

PRINT “SUM OF TWO NUMBERS”; S

END

FUNCTION SUM (A, B)

SU = A + B

SUM = SU

END FUNCTION

2. Enter any two numbers and display its difference.

REM PROGRAM TO DISPLAY DIFFERENCE OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

D = A - B

PRINT “DIFFERENCE OF TWO NUMBERS”; D

END

USING SUB PROCEDURE

DECLARE SUB DIFF (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL DIFF(A, B)

END

SUB DIFF (A, B)

D = A - B

PRINT “DIFFERENCE OF TWO NUMBERS”; D

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION DIFF (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

DI = DIFF(A, B)

PRINT “DIFFERENCE OF TWO NUMBERS”; DI

END

FUNCTION DIFF (A, B)

D = A - B

DIFF = D

END FUNCTION

3. Enter any two numbers and display its product.

REM PROGRAM TO DISPLAY PRODUCT OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

P = A * B

PRINT “PRODUCT OF TWO NUMBERS”; P

END

USING SUB PROCEDURE

DECLARE SUB PROD (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL PROD(A, B)

END

SUB PROD (A, B)

P = A * B

PRINT “PRODUCT OF TWO NUMBERS”; P

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION PROD (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

PR = PROD(A, B)

PRINT “PRODUCT OF TWO NUMBERS”; PR

END

FUNCTION PROD (A, B)

P = A * B

PROD = P

END FUNCTION

4. Enter any two numbers and display its average.

REM PROGRAM TO DISPLAY AVERAGE OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

AV = (A + B) / 2

PRINT “AVERAGE OF TWO NUMBERS”; AV

END

USING SUB PROCEDURE

DECLARE SUB AVERAGE (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

CALL AVERAGE(A, B)

END

SUB AVERAGE (A, B)

AV = (A + B) / 2

PRINT “AVERAGE OF TWO NUMBERS”; AV

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AVERAGE (A, B)

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

AVGR = AVERAGE(A, B)

PRINT “AVERAGE OF TWO NUMBERS”; AVGR

END

FUNCTION AVERAGE (A, B)

AV = (A + B) / 2

AVERAGE = AV

END FUNCTION

Explanation:

Pls mark brainliest

8 0
2 years ago
Read 2 more answers
What two devices in a computer should be considered "black boxes," and should never be opened due to risks involving charged cap
NNADVOKAT [17]

The two devices in a computer that should be considered "black boxes," and should never be opened due to risks involving charged capacitors are MONITOR and POWER SUPPLY.

Explanation:

  • Physical contact or close proximity to the open power supply caused a discharge from the capacitor that resulted in an electric shock. Capacitors can discharge current even when not energized because they hold a charge for some time after the power is turned off.
  • To do harm to your body, the voltage across the capacitor's terminals must be high enough to cause a harmful effect on you. There are no hard rules for at what voltage things become harmful, but a common 'rule of thumb' is that DC up to 48 Volt is considered low voltage. So a capacitor charged to a voltage below 48 V is fairly safe.
  • A charged capacitor can be very dangerous, so it's important that you avoid coming into contact with the terminals at all times.
3 0
3 years ago
Other questions:
  • Austin works as a department head and frequently uses presentations to deliver information to his staff. He relies heavily on pr
    5·2 answers
  • When installing a device driver, start the computer in
    14·1 answer
  • Why is Bot_Seth Trash at video games?
    13·2 answers
  • Using this tool to help you to visualize your slides and develop your content
    13·1 answer
  • Stopping, standing, or parking is prohibited _____________.
    14·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • What is wrong with the following C++ code? How would you fix it? int sum; for (int i=0; i&lt;1000; ++i) sum += i; { printf("Sum
    5·1 answer
  • In Scheme, source code is data. Every non-atomic expression is written as a Scheme list, so we can write procedures that manipul
    8·1 answer
  • The following program is run. Then the user clicks the "bottomButton" TWO TIMES. What will be displayed in the console?
    6·2 answers
  • What was Bill Gates purpose for starting a business?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!