Some items to check for... Does the file open correctly Are there more integers
ID: 3615532 • Letter: S
Question
Some items to check for...
Does the file open correctly
Are there more integers in the file than locations in thearray (array index out of bounds)
Additional Features...
Allow the user to make the integer entry multiple timeswithout restarting the program
NOTE: Use functions for all major pieces ofcode. "main" should consist mostly of function calls. Use value and reference parameters appropriately to allow/preventchanging values.
# include <isotream>
# include <fstream>
using namespace std;
void openfile(int&, infile)
void int array(int array[], int array, int length0
void insertionSort( int array[], int arrayLength)
void userInterface (const int array []' int arraylength)
void binarySearch ( const int array [], int arrayLength, intnumber, int& index)
int main ()
{
int array [50];
istream infile;
open(file);
mitArray(array, arrayLength, infile);
userInterface(array, arrayLength);
binarySearch( array, arrayLength, number,index)
Explanation / Answer
please rate - thanks this one too /computer-science-answers-5-723889-cpi0.aspx hope this is good # include # include #define MAX 50 using namespace std; void openfile(ifstream& infile,int &code); void readvalue(ifstream& inFile, int array[], int&arrayLength,int& code); void insertionSort(int array[], int &arrayLength,int&code,int value); void userInterface (int &number); void binarySearch ( const int array [], int arrayLength, intnumber,int &loc); void print(int array[],int arrayLength, string mess); int main () {int array [MAX],arrayLength=0,loc=0,number=0,code=0; ifstream infile; openfile(infile,code); if(code==0) { readvalue(infile,array,arrayLength,code); if(code==1) coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.