List
Looking at the program “Salesperson’s list”, create another
program that will do the following:
1. Ask user to input 2 different lists of salespersons.
2. Concatenate two lists into one.
In order to do that you will have to create second list
(define another pointer to the head and another pointer to the current), and
write function that will add one list to the other. This function has to
redefine pointer of the last element of the first list, so that it will point
to the first element of the second list.
Print new list in the form of the report.
Salesperson’s list
include
<iostream>
#
include <string>
using
namespace std;
struct
SalesPerson {
SalesPerson *next;
string name;
int level;
float comission;
float amount;
void Print()
{
[login to view URL](10);
cout << name;
[login to view URL](20);
cout << level;
[login to view URL](20);
cout << amount;
[login to view URL](20);
cout << comission <<
endl << endl;
}
};
struct SalesPerson* Head = NULL;
struct SalesPerson* Current =
NULL;
void Add(struct SalesPerson);
void
main()
{
struct SalesPerson S;
char answer[10] =
"Yes";
do
{
cout << "\nEnter
sales person name: ";
cin >> [login to view URL];
cout << "\nEnter
sales amount: ";
cin >> [login to view URL];
cout << "\nEnter
level of comisiions: ";
cin >> [login to view URL];
cout << endl;
Add(S);
cout << "Do you want
to enter another? (Yes/No): ";
cin >> answer;
} while (strcmp(answer,
"No") != 0);
[login to view URL](10);
cout << "Name";
[login to view URL](20);
cout << "Comission
level";
[login to view URL](20);
cout << "Amount of sales";
[login to view URL](20);
cout <<
"Comission" << endl << endl;
for(Current = Head; Current
-> next != NULL; Current = Current -> next)
Current ->
Print();
Current -> Print();
}
void
Add(struct SalesPerson a)
{
if (Current == NULL)
{
Current = new(SalesPerson);
Head = Current;
Current ->
next = NULL;
}
else
{
Current ->
next = new(SalesPerson);
Current =
Current -> next;
Current ->
next = NULL;
}
Current -> name = [login to view URL];
Current -> level = [login to view URL];
Current -> amount = [login to view URL];
if([login to view URL] == 1) Current ->
comission = [login to view URL] * 0.06;
else Current
-> comission = [login to view URL] * 0.08;
}
Contact me for an efficient, perfect,
well documented development of your project according
to 100% accuracy and requirements, with dedicated
support. Thanks
Hi,
With 10 years of professional programming experience with C++ and various other languages, I can implement your program which asks for 2 lists and then concatenates them.
I am ready to begin now!
Thanks
Hi,
I would be happy to help you, I have a master degree in electronics and computer science engineering. I've been programing in c++ for many years, and your work is a piece of cake for me.
pm so we can discuss. You won't regret and consider it as done.
cheers
HI, I have a great experience in c++ and data structures. So, you can hire me and you don't spend your money and time for nothing.
Yesterday I finished a project, connected with a creating a game. You can ask my employee about the cuality of my work :)
Hello, sir. I would love to work for you. I have 5 years experience in C/C++ programming language. I can help you do this project. Thank you so much for your attention.
You are using Linked lists, I I'm very adept in the use of Linked lists in C++.
please email me if you have and questions.
thank you for your consideration.
Hi,
I am an experienced C/c++ developer.
I have seen your requirement and i am ready to do this project.
I will provide you the executable first, you can check it and then need to pay.
Please assign me the project. I am ready to start project right now.
Thanks!