For each user who comes to your site the google analytics automatically capture the traffic source dimensions Source, Medium, Campaign name.
<u>Explanation:</u>
Source:
- There cannot be any reference to a website without an origin source.
- The source is basically the origin of your traffic such as a search engine (google) or a domain (ex: Twitter).
Medium:
- Every referral to a website also has a medium along with the source.
- examples are -: unpaid search, "cost per click", referral, mail.
Campaign name:
- The campaign Name is the name referring to the google ads campaign.
Answer:
The function is as follows:
void readAndConvert(){
int n; string symbol,name;
cin>>n;
cin>>symbol;
cin.ignore();
getline (cin,name);
vector<string> trades;
string trade;
for (int inps = 0; inps < n; inps++){
getline (cin,trade);
trades.push_back(trade);}
cout<<name<<" ("<<symbol<<")"<<endl;
for (int itr = 0; itr < n; itr++){
string splittrade[3]; int k = 0;
for(int j=0;j<trades.at(itr).length();j++){
splittrade[k] += trades.at(itr)[j];
if(trades.at(itr)[j] == ' '){
k++; }}
cout<<splittrade[2]<<": "<<floor(stod(splittrade[1]) * stod(splittrade[0]))<<endl; }
}
Explanation:
See attachment for complete program where comments are used to explain each line
I think coders put in codes. Sry if that does not help.