Asked by Sai Chowdary
A company wants to know the percentages of total sales and total expenses attributable to each salesperson. The data is stored in a text file. In the file, each person has a pair of data lines. The first line contains his or her name, last name name first. The second line contains his or her sales (int) and expenses (float).
Define a class named SalesPerson that holds one salesperson's information. And then create another class named SalesReport that associates with the list of salespersons. And searching and sorting are based on comparisons of strings (salespersons' names).
Write a program that produces a report (text file) with a header line containing the total sales and total expenses. Following this header should be a table with each salesperson's name, percentage of total sales, and percentage of total expenses, sorted by salesperson's name.
Define a class named SalesPerson that holds one salesperson's information. And then create another class named SalesReport that associates with the list of salespersons. And searching and sorting are based on comparisons of strings (salespersons' names).
Write a program that produces a report (text file) with a header line containing the total sales and total expenses. Following this header should be a table with each salesperson's name, percentage of total sales, and percentage of total expenses, sorted by salesperson's name.
Answers
Answered by
Victoria
Did you take Foundations of programming?
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.