In: Computer Science
Brewster’s Used Cars, Inc. employs several salespeople. Brewster, the owner of the company, has provided a file that contains sales records for each salesperson for the past month. Each record in the file contains the following two fields:
The salesperson’s ID number, as an integer
The amount of a sale, as a real number
The records are already sorted by salesperson ID. Brewster wants you to design a program that prints a sales report. The report should show each salesperson’ssales and the total sales for that salesperson. The report should also show the total sales for all salespeople for the month. Here is an example of how the sales report should appear:
Brewster's Used Cars, Inc.
Sales Report
Salesperson ID
Sale Amount
===========================================
100
$10,000.00
100
$12,000.00
100
$5,000.00
Total sales for this salesperson: $27,000.00
101
$14,000.00
101
$18,000.00
101
$12,500.00
Total sales for this salesperson: $44,500.00
102
$13,500.00
102
$14,500.00
102
$20,000.00
Total sales for this salesperson: $48,000.00
Total of all sales: $119,500.00
I need help making a flowchart in Raptor with sub Modules.
#include<bits/stdc++.h>
using namespace std ;
#include<bits/stdc++.h>
using namespace std ;
struct report{
int salesmanId;
double sales;
};
int main()
{
int n;
cout<<"enter total no. of salesman = ";
cin>>n;
struct report s[n*3];
int cnt=0,i;
double sum=0.0,totalsum=0.0;
for(i=0;i<n*3;i++)
{
cout<<"\nEnter salesman Id:
";
cin>>s[i].salesmanId;
cout<<"\nEnter sales for this
salesman: $";
cin>>s[i].sales;
}
for(i=0;i<n*3;i++)
{
cout<<s[i].salesmanId<<"\n$"<< fixed<<
setprecision(2)<<s[i].sales<<"\n";
cnt++;
sum+=s[i].sales;
if(cnt==3)
{
totalsum+=sum;
cout<<"Total sales for this salesperson: $"<<
fixed<< setprecision(2)<<sum<<"\n";
sum=0.0;
cnt=0;
}
}
cout<<"Total of all sales: $"<<
fixed<<setprecision(2)<<totalsum<<"\n";
return 0;
}
struct report{
int salesmanId;
double sales;
};
int main()
{
int n;
cout<<"enter total no. of salesman = ";
cin>>n;
struct report s[n*3];
int cnt=0,i;
double sum=0.0,totalsum=0.0;
for(i=0;i<n*3;i++)
{
cout<<"\nEnter salesman Id:
";
cin>>s[i].salesmanId;
cout<<"\nEnter sales for this
salesman: $";
cin>>s[i].sales;
}
for(i=0;i<n*3;i++)
{
cout<<s[i].salesmanId<<"\n$"<< fixed<<
setprecision(2)<<s[i].sales<<"\n";
cnt++;
sum+=s[i].sales;
if(cnt==3)
{
totalsum+=sum;
cout<<"Total sales for this salesperson: $"<<
fixed<< setprecision(2)<<sum<<"\n";
sum=0.0;
cnt=0;
}
}
cout<<"Total of all sales: $"<<
fixed<<setprecision(2)<<totalsum<<"\n";
return 0;
}
FLOWCHART FOR THE QUESTION