Question: I made a c++ code that takes inputted float txt file and stores them into an array as first part of the program. Then the

I made a c++ code that takes inputted float txt file and stores them into an array as first part of the program. Then the program calls a function to use selection sort on the array. The program prompts the user to search for a value in the array. The program then uses binary search to find that value in the array and gives it back to the user, prompting for another value to find. So far I've gotten this

//inputs an float file int main() { int ARRAY_SIZE = 4; //array size is 100 max float numbers [ARRAY_SIZE]; int count = 0; //only loop once ifstream inputFile; //input file steam object

//Open the file inputFile.open("floatnumbers.txt");

//read the numbers from the file into the array while ( count < ARRAY_SIZE && inputFile >> numbers [count]) count++;

//close the file inputFile.close();

/*Display the numbers read cout << "The numbers are: *"; for (count = 0; count < ARRAY_SIZE; count++) cout << numbers [count] << " "; cout <

cout << "Enter a value to search for: "; getline(cin, count); position = binarySearch(numbers, count); return 0; }//end main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!