Question

In: Computer Science

Brewster’s Used Cars, Inc. employs several salespeople. Brewster, the owner of the company, has provided a...

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.

Solutions

Expert Solution

#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


Related Solutions

Respond to the following in a minimum of 175 words: A company employs 400 salespeople. Of...
Respond to the following in a minimum of 175 words: A company employs 400 salespeople. Of these, 83 received a bonus last year, 100 attended a special sales training program at the beginning of last year, and 42 both attended the special sales training program and received a bonus. (Note: the bonus was based totally on sales performance.) a) What proportion of the 400 salespeople received a bonus last year? b) What proportion of the 400 salespeople attended the special...
The number of cars sold annually by used car salespeople is normally distributed with a standard...
The number of cars sold annually by used car salespeople is normally distributed with a standard deviation of σ = 15. A random sample of 36 salespeople was taken and the mean number of cars sold annually was found to be 141. Find the 99% confidence interval estimate of the population mean. Note: For each confidence interval, enter your answer in the form (LCL, UCL). You must include the parentheses and the comma between the confidence limits. (a) [3 pts]...
The number of cars sold annually by used car salespeople is normally distributed with a standard...
The number of cars sold annually by used car salespeople is normally distributed with a standard deviation of 14. A random sample of 300 salespeople was taken and the mean number of cars sold annually was found to be 69. Find the 92% confidence interval estimate of the population mean. Note: For each confidence interval, enter your answer in the form (LCL, UCL). You must include the parentheses and the comma between the confidence limits. Confidence Interval =
The number of cars sold annually by used car salespeople is normally distributed with a standard...
The number of cars sold annually by used car salespeople is normally distributed with a standard deviation of 15. A random sample of 390 salespeople was taken and the mean number of cars sold annually was found to be 77. Find the 91% confidence interval estimate of the population mean. Note: For each confidence interval, enter your answer in the form (LCL, UCL). You must include the parentheses and the comma between the confidence limits. Confidence Interval =
A company employs 500 salespeople. Of these, 156 received a bonus last year, 200 attended a...
A company employs 500 salespeople. Of these, 156 received a bonus last year, 200 attended a special sales training program at the beginning of last year, and 83 both attended the special sales training program and received a bonus. The bonus was based totally on sales performance. What proportion of the 500 salespeople received a bonus last year? What proportion of the 500 salespeople attended the special sales training program at the beginning of last year? What proportion of the...
Web Wizard, Inc., has provided information technology services for several years. The company uses the percentage...
Web Wizard, Inc., has provided information technology services for several years. The company uses the percentage of credit sales method to estimate bad debts for internal monthly reporting purposes. At the end of each quarter, the company adjusts its records using the aging of accounts receivable method. The company entered into the following selected transactions during the first quarter of 2017: During January, the company provided services for $40,000 on credit. On January 31, the company estimated bad debts using...
Web Wizard, Inc., has provided information technology services for several years. The company uses the percentage...
Web Wizard, Inc., has provided information technology services for several years. The company uses the percentage of credit sales method to estimate bad debts for internal monthly reporting purposes. At the end of each quarter, the company adjusts its records using the aging of accounts receivable method. The company entered into the following selected transactions during the first quarter of 2017: During January, the company provided services for $40,000 on credit. On January 31, the company estimated bad debts using...
A property owner has provided you with the following information. Assume the owner has no other...
A property owner has provided you with the following information. Assume the owner has no other assets or liabilities. The annual gross revenue is $3,275,000. The debt service payment on the loan is $147,000 per month. The capitalization rate is 8%. Assets: Cash $ 1,000,000 Land 1,500,000 Building 29,500,000 Total Assets $ 32,000,000 Liabilities & Equity: Nonrecourse Liabilities $ 25,000,000 Partner’s Capital 7,000,000 Total Liabilities & Capital $ 32,000,000 14. What is the property’s NOI? Calculate the Debt Service Coverage...
Leon has worked for a small tool and die company for several years. The owner is...
Leon has worked for a small tool and die company for several years. The owner is retiring and Leon has the opportunity to purchase the business. However, he plans to retire in 10 years, and he knows that neither of his children has any desire to work in the business. What appears to be Leon’s key consideration in choosing an ownership structure? a. Business control and transfer of ownership b. Ease of start-up and administration c. Management structure d. Legal...
A used car lot has 150 cars, 90 of the cars are black and 60 cars...
A used car lot has 150 cars, 90 of the cars are black and 60 cars are blue. What is the probability of 2 blue cars being test drove back to back; assuming the first car is purchased? What is the probability of 2 blue cars being test drove back to back; assuming the first car was not purchased?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT