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.

1 answer

Did you take Foundations of programming?