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
Lisa [10]
3 years ago
5

Finding values in an array

Computers and Technology
1 answer:
hjlf3 years ago
8 0

Answer:

The following code completes the program

for (i = 0; i < userValues.length; i++) {

     if(userValues[i] == matchValue){

         nuMatches++;

     }  }

 System.out.println(nuMatches);

Explanation:

<em>The question is poorly formatted. So, I correct the poorly formatted program segment and I complete the missing part of the program.</em>

<em>See attachment for complete program.</em>

The explanation is as follows:

This iterates through the array

for (i = 0; i < u s e r V a l u e s. length; i++) {

This checks if the current array element is the same as the match value

     if(userValues[i] == matchValue){

If yes, the number of matches is increased by 1

         nuMatches++;

     }  }

This prints the number of matches

 System.out.println(nuMatches);

Download txt
You might be interested in
An effective team would never have ______.
inysia [295]
An ineffective leader
3 0
3 years ago
You are a trainer for your company and often teach courses in a classroom located on-campus or in a hotel conference room. In yo
Alisiya [41]

Answer:

Duplicate these displays.

Explanation:

<u>A. Show only on 1</u> <em>displays only the first screen and disconnects the second one</em>

<u>B. Extend these displays</u> <em>displays two different outputs on the same computer</em>

<u>C. Show only on 2.</u> <em>displays only the second screen and disconnects the first one</em>

<u>D. Duplicate these displays.</u> <em>displays the same output for both screen</em>

5 0
3 years ago
Read 2 more answers
How to download music to your mp3 player off computer
skelet666 [1.2K]
For free or for money cuz for free u would do ot on ur mp3 and money i would yse apple music
3 0
3 years ago
Package Newton’s method for approximating square roots (Case Study 3.6) in a function named newton. This function expects the in
notka56 [123]

Answer:

import math

#Initialize tolerance

tolerance = 0.000001

def newton(x):

   """ Returns the square root of x """

   #Performs the successive approximations

   estimate = 1.0

   while True:

       estimate = (estimate + x / estimate) / 2

       difference = abs(x - estimate ** 2)

       if difference <= tolerance:     # Break out of loop if difference is less than tolerance

           break            

       return estimate     # While the difference value is > TOLERANCE, the process continues

def main():

   """Allows the user to obtain square roots."""

   while True:

       #Receive the input number from the user

       x = input("Enter a positive number or enter/return to quit: ")

       if x == "":     #if user presses "Enter" then exit the program

           break       # Otherwise, continue the process of allowing new numbers

       x = float(x)

       #Output the result

       print("The programs estimate of the square root of ", x, "is ", round(newton(x),2))

       print("Python's estimate: ", math.sqrt(x))

main()

8 0
3 years ago
At higher doses what behaves like PCP causing feelings of power and invulnerability
ser-zykov [4K]
I don't think any answer would be correct, if you have an option "none of the above" then that would be the correct answer
5 0
3 years ago
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    5·1 answer
  • What is the term for a device that converts digital data from a computer into analog signals and back again?
    9·1 answer
  • When would a one way flag variable be used
    10·1 answer
  • What are the prime factorizations of 52 and 77? a. b.
    5·1 answer
  • The algorithm credited to Euclid for easily finding the greatest common divisor of two integers has broad significance in crypto
    11·1 answer
  • What's a good app that solves trigonometry problems?
    8·1 answer
  • 802.11ac provides an advantage over 802.11n by incorporating increased channel bonding capabilities. What size bonded channels d
    10·1 answer
  • To check if your operating system is up to date, click Start then click Control Panel and choose _______________. Select one: a.
    11·1 answer
  • If, when asked for a date of birth, the user enters a future date, this error should be caught by a ________ check.
    8·1 answer
  • Barbara, an employee, has properly connected her personal wireless router to a network jack inside her office. The router is una
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!