Question: Programming Langauge: C++ 1. Read the problem. Write a program that reads sales data from individual sales associates, calculates their standing, determines the associate with
Programming Langauge: C++
| 1. | Read the problem. Write a program that reads sales data from individual sales associates, calculates their standing, determines the associate with the highest sales, and writes the data to a text file. Sales data should be stored in a struct variable of typeSalesType, which has six components: LastName, FirstName,and Region of type string, MonthlySales of type float, Statusof type string, and HighSales of type boolean. Input file contains this data
Savoy Daron Fairfield 1803.52 Stevenson Shaniya Vacaville 1571.06 Langlois Darin Fairfield 2012.06 Layne Casandra Vacaville 2101.25 Backus Felipe Fairfield 3852.00 Anderson Andrew Vacaville 2510.75 Brody Irwin Vacaville 3299.77 Polanco Belva Dixon 2025.00 Cummings Savanna Dixon 1906.78 Nevarez Cecile Fairfield 1628.47 Winfrey Humberto Vacaville 1470.88 Quinn Shamika Vallejo 5874.19 Crocker Leanne Vacaville 1598.63 Strassberg Gerson Vallejo 1835.16 Mcnair Alena Fairfield 1250.00 Harper Brennon Fairfield 998.09 Tomlin Ellen Vallejo 877.25 Zeller Lavern Elmira 1103.16 Barnett Rosalyn Vallejo 2657.81 Couture Tremayne Fairfield 1408.85 Mccool Deon Fairfield 1549.13 Powell Neta Fairfield 1515.94 Steel Fletcher Fairfield 1155.69 Anderson Valary Vacaville 2873.75 Brown Michael Fairfield 1956.94 Youngblood Maribeth Fairfield 1704.55 Cedeno Dusty Vallejo 3675.75 Flanagan Giselle Fairfield 1512.50 Cosgrove Mitch Fairfield 551.25 Lear Shande Vallejo 1438.83 Field Jill Suisun 1208.22 Ellington Jame Fairfield 2656.25 Layman Lanny Suisun 4500.00 Mccormick Sonia Fairfield 1759.80 Knapp Zelda Vacaville 1542.75 Hogg Darrien Fairfield 2153.78 Rey Alvino Vacaville 2408.25 Ridley Fannie Fairfield 1391.50 Wheaton Ronnie Fairfield 1776.00 Crandall Walker Fairfield 945.56 Garero Devon Vacaville 1460.81 Rupert Barrett Fairfield 3464.50 Johnsen Damian Dixon 2088.28 Wildon Sarah Pinole 2420.00 Ruff Alma Vallejo 2326.20 Kearns Ashanti Fairfield 975.00 Donohue Brook Vallejo 1819.13 Lopez Dudley Suisun 3506.75 Larue Emogene Fairfield 2964.50 Beatty Jaylene Fairfield 1956.94 Walsh Joe Fairfield 1708.88 Hoyt Laquita Vallejo 1917.39 Gaddis Rand Vacaville 2370.38 Dillon Trena Vallejo 1339.55 Simpson Ona Vacaville 1733.44 Conger Garett Fairfield 2281.31 Lanham Malcolm Vallejo 898.44 Tindall Jacob Travis 4800.00 Parkinson Carl Pinole 2420.00 Warez Amber Fairfield 2468.97 ------------------------------------------------------------------------------------------------------------------------------------------------------- The file contains 60 records. Load the records into an array of type SalesType containing 60 elements. Your program must contain at least the following functions:
Determine the sales associate's Status using the following table:
The output file should be a text file with the following data:LastName, FirstName, Region, MonthlySales and Status. Each of these items should be separated by 3 spaces. Each sales associate's record should be on a separate line in the file. The sales associate, or associates with the highest monthly sales should have the text "Performer" appended to their record (separated from the Status by 1 space). Other than declaring the variables and opening the input and output files, the function main should only be a collection of function calls.
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
