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 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
While inserting images, the picture command is usually used to insert photos from a digital camera, and the clip art command is usually used to a.edit the sizes and other characteristics of photos that have been inserted. b.take a screenshot of an image and copy it to the clipboard for pasting. c.search for drawings or other images from a library of prepared pictures. d.make illustrations using lines and shapes that are easy to manipulate.
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
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
question
History, 12.07.2019 07:00
question
Mathematics, 12.07.2019 07:00
question
Mathematics, 12.07.2019 07:00
Questions on the website: 13722360