subject

So i'm using kahn academy but it keeps saying i have bad invocation in {guess = 3((max + min) / 2); } right before the three. i am not sure what i'm doing wrong can someone ? (this is using javascript) ? i will give good points and brainliest. the instructions given were: 1. let min = 0 and max = n-1.2. if max < min, then stop: target is not present in array. return -1.3. compute guess as the average of max and min, rounded down (so that it is an integer).4. if array[guess] equals target, then stop. you found it! return guess.5. if the guess was too low, that is, array[guess] < target, then set min = guess + 1.6. otherwise, the guess was too high. set max = guess - 1.7. go back to step 2./* returns either the index of the location in the array, or -1 if the array did not contain the targetvalue */var min = 0; var max = array. length - 1; var guess; while (min < max) {guess = 3((max + min) / 2); if (array[guess] === targetvalue) {return guess; } else if (array[guess] < targetvalue) {min = guess - 1; } else {max = guess + 1; }}return -1; }; var primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]; var result = dosearch(primes, 73); console. log("found prime at index " + result); //print (primes[]); //program. assertequal(dosearch(primes, 73), 20);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
You know the right answer?
So i'm using kahn academy but it keeps saying i have bad invocation in {guess = 3((max + min) / 2);...
Questions
question
Geography, 30.11.2020 22:10
question
Mathematics, 30.11.2020 22:10
Questions on the website: 13722361