1. A company has 100 employees whose records consist of Employeenumber Employee
ID: 3610109 • Letter: 1
Question
1. A company has 100 employees whose records consist of
Employeenumber Employee name
A sample of data is givenbelow. Write separate programs for searches for akey whose value is to be input in each ofthe following cases:
emp# emp name
121267 Bryan Devaux
045128 Shouli Feldman
379452 Mary Dodd
160252 Tuan Ngo
378845 Patrick Linn
070918 Sarah Trapp
166702 Harry Eagle
572556 Chris Walljasper
167010 JohnSmith
Explanation / Answer
please rate - thanks sort and sequential search - I assumed you haven't learnedfunctions yet #include #include using namespace std; int main() { string first[100],last[100],stemp ; int i,j,id[100],key,max=0,temp; ifstream in; in.open("name.txt"); //open file if(in.fail()) //is it ok? { coutid[max]; while(in) {in>>first[max]>>last[max]; max++; in>>id[max]; } for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.