Question
In C++ the out put should like this This is my code **// SeqSearch.h //** #include #include #include #include using namespace std; int MAXINDEX =
In C++
the out put should like this
This is my code
**// SeqSearch.h //**
#include
using namespace std; int MAXINDEX = 100; class seqSearch { private: int position; int Array[]; public: seqSearch(); seqSearch(int, int);
int seq(int array[], int count, int target); void generateArray(int array[], int count); void printArray(int array[], int count);
};
**// SeqSearch.cpp//**
#include "SeqSearch.h"
using namespace std;
count = MAXINDEX;
seqSearch::seqSearch() { position = 0; Array[100];
} seqSearch::seqSearch(int array[], int p) { position = p; Array[] = array[]; }
int seqSearch::seq(int array[], int count, int target) { for(int = 0; i
return -1; }
void generateArray(int array[], int count) { srand(time(0)); for(int i = 0; i
void printArray(int array[], int count) { cout "; for(int i = 0; i
cout
if(i % 10 == 9) cout
cout
**// SeqMain.cpp//**
#include "SeqSearch.h" #include
using namespace std;
int main() { seqSearch s; int array[MAXINDEX], num, position; //array[MAXINDEX];
//seqSearch(array, position);
s.generateArray(array, MAXINDEX);
cout
cout > num; position = s.seq(array, MAXINDEX, num);
if(position == -1) { cout
} else { cout
}
return 0;
}
Can anyone help me with this please
SeqSearch bash 80x24 Clang: error: no such file or directory Seq Main.cpp clang Merror: no input files Size Apples MacBook-Pro ab2 apples cd SeqSearch Apples MacBook-Pro Seq Search apple$ g++ -c Seq Search cpp Apples MacBook Pro SeqSearch apple$ g++ -c Seq Main cpp Apples MacBook-Pro Seq Search apple$ g++ Seq Main o Seq Search o -o output Apples MacBook Pro Seq Search apple$ output Here is the content of the array 4380 Ones 393 tels 5:41 erIS 0 I 89 l 254 l 936 l 91 l 566 l 693 l 806 736 l 864 l 623 l 1 859 l 823 l 3, 27 l 476 l 90 l 861 503 I 118 l 834 594 l 2 I 887 IM 638 I 46 l 341 317arra697 In 114 347 282 725 3 l 127 765 l 412 l 229 l 539 929 l 436 l 629 l 289 l 518 4 l l 770 l 955 l 968 l 52 l 859 l 401 252 734 l 245 441 l 5 l 960 576 l 349 l 952 l 174 l 333 l 328 l 305 l 199 l 329 6 520 427 650 785 14 l 180 l .271 733 1 ara 7 del 916 609 997 555 167 62 8 II 466 l 16 l 210 l 663 la 324 l 343 i979 l 504 l 302 l 988 9 l 859 l 651 954 l 385 506 l 165 719 l 930 l 625 l 303 Enter the number to search for 91 Found 91 in position 3 Apples-MacBook-Pro SeqSearch apple$Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started