Help Please:( Please run the program and provide a screenshot of the popup with
ID: 3829097 • Letter: H
Question
Help Please:(
Please run the program and provide a screenshot of the popup with the output result, with the solution. The screenshot should display the small example of a subset of a run of this program that is shown at the bottom of the directions. If you cannot get this desired result please do not answer the question. This is my third time asking:(
c++
Write your own version of a class template that will create a binary tree that can hold values of any data type.
Then, design an EmployeeInfo class that holds the following employee information:
Employee ID Number:an integer
Employee Name:a string
Next, use the template you designed to implement a binary tree whose nodes hold an instance of the EmployeeInfo class. The nodes should be sorted on the Employee ID number.
Test the binary tree by inserting nodes with the following information.
Employee ID NumberName
1021John Williams
1057Bill Witherspoon
2487Jennifer Twain
3769Sophia Lancaster
1017Debbie Reece
1275George McMullen
1899Ashley Smith
4218Josh Plemmons
Your program should allow the user to enter an ID number, then search the tree for the number. If the number is found, it should display the employee’s name. If the node is not found, it should display a message indicating so.
Please run the program to make sure that it gives this provided output............................
The following is a small example of a subset of a run of this program:
Here is the workforce:
ID Number: 1017 Name: Debbie Reece
ID Number: 1021 Name: John Williams
ID Number: 1057 Name: Bill Witherspoon
ID Number: 1275 Name: George McMullen
ID Number: 1899 Name: Ashley Smith
ID Number: 2487 Name: Jennifer Twain
ID Number: 3769 Name: Sophia Lancaster
ID Number: 4218 Name: Josh Plemmons
Enter an employee number: 3769
Employee was found:
ID Number: 3769 Name: Sophia Lancaster
Explanation / Answer
# Program :
#include <iostream>
using namespace std;
struct Employee
{
int Id;
char Name[25];
};
//Ghanendra Ydav
int main()
{
int i,num,found;
Employee Emp[ ] = {{1021,"ohn Williams"},{1057,"Bill Witherspoon"},{2487,"Jennifer Twain"},{3769,"Sophia Lancaster"},{1017,"Debbie Reece"},{1275,"George McMullen"},{1899,"Ashley Smith"},{4218,"Josh Plemmons"}};
cout << " Here is the Workforce ";
for(i=0;i<7;i++)
{
cout << "ID Number:"<< Emp[i].Id <<" Name:"<< Emp[i].Name;
cout <<" ";
}
cout << " Enter an employee number:";
cin >> num;
for(i=0;i<7;i++)
{
if(Emp[i].Id == num)
{
cout << " Employee was found: ";
cout << "ID Number:"<< Emp[i].Id <<" Name:"<< Emp[i].Name;
found = 1;
cout <<" ";
}
}
if(found != 1)
{
cout << "Employee was not found";
cout <<" ";
}
}
Output :
sh-4.2$ g++ -o main *.cpp
sh-4.2$ main
Here is the Workforce
ID Number:1021 Name:ohn Williams
ID Number:1057 Name:Bill Witherspoon
ID Number:2487 Name:Jennifer Twain
ID Number:3769 Name:Sophia Lancaster
ID Number:1017 Name:Debbie Reece
ID Number:1275 Name:George McMullen
ID Number:1899 Name:Ashley Smith
Enter an employee number:1275
Employee was found:
ID Number:1275 Name:George McMullen
sh-4.2$ g++ -o main *.cpp
sh-4.2$ main
Here is the Workforce
ID Number:1021 Name:ohn Williams
ID Number:1057 Name:Bill Witherspoon
ID Number:2487 Name:Jennifer Twain
ID Number:3769 Name:Sophia Lancaster
ID Number:1017 Name:Debbie Reece
ID Number:1275 Name:George McMullen
ID Number:1899 Name:Ashley Smith
Enter an employee number:1434
Employee was not found
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.