subject

Write a program that reads numbers from a file named nums. txt Download nums. txt and saves them in an array. your array should be all filled and has the exact size of the number of data in the file. You should count how many numbers the file has, then create your array. The program should then prompt the user for an integer which will be searched for in the array using a binary search. Make sure to include the following steps along the way: i)A sort function must be called before the binary search. You may use either the selection sort or the bubble sort. However, the sort must be implemented in its own function and not in main. ii) A binary search function must be called by main to implement the binary search. The ordered array produced by the sort should be passed to the search function which returns the location in the sorted array of the sought value, or -1 if the value is not in the array. iii) Add a value-returning function that computes the mean of your data set. Recall that the mean is the sum of the data values divided by the number of pieces of data. Your program should output the size of the array entered, the array as entered by the user, the sorted array, the integer being searched for, the location of that integer in the sorted array (or an appropriate message if it is not in the array), and the mean of the data set. The output must be saved to a text file and output to the screen. Sample run: Sample run: Enter an integer to search for: 100 // notice that your program must save the same output in a file. This array has 12 items. The array entered by the user is as follows: 22 -4 5 100 39 20 88 10 55 3 10 78 The sorted array is as follows: -4 3 5 10 10 20 22 39 55 78 88 100 The item searched for is 100 The value 100 is in position number 12 of the list The mean of all the elements in the array is 35.5

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
Your is an example of personal information that you should keep private.
Answers: 1
You know the right answer?
Write a program that reads numbers from a file named nums. txt Download nums. txt and saves them in...
Questions
Questions on the website: 13722367