Project Assignment
Course: COSC 1436 (C++)
Term: Mode:
Instructor: Abass Alamnehe
Purpose: Project II Assignment: Aggregate Sales Data
Requirement
▪ Use Visual Studio. ▪ To submit, package your work in Visual Studio project with ZIP format. ▪ Submit your work on http://eagleonline.hccs.edu (Eagle Online) by due date.
Resources
Visual Studio Site
https://visualstudio.microsoft.com/free-developer-offers/
Getting Started with Visual Studio
https://mva.microsoft.com/en-US/training-courses/getting-started-with-visual-studio-2017
17798?l=9oIw0FD6D_3611787171
C++ Coding Convention
https://google.github.io/styleguide/cppguide.html
Digital & Information Technology
Houston Community College
Project Aggregate Data
Learning Outcomes
At the end of the project, the expected learning outcomes:
▪ Analyze and develop solution. ▪ Use loops to process repeated input stream. ▪ Perform file input/output operations with multiple files. ▪ Declare initialized variables and objects. ▪ Use proper data types to store and process. ▪ Write expressions to solve problems. ▪ Integrate error checking mechanism in the code.
Project Requirement
The purpose of this project is to process sales data and produce an aggregated result. The sales data comes from four cities--nameply “austin.txt”, “dallas.txt”, “houston.txt”, and “san_antonio.txt”. The objective is to aggregate the data from all the cities and produce the total sales of each product.
▪ The product list and its order from each city is the same; however, the sales figure is different. ▪ There are four cities represented by “austin.txt”, “dallas.txt”, “houston.txt”, and “san_antonio.txt”. And these files are furmished along with the project assignment. ▪ There are eight products with two fields--“Product” and “Sales”. ▪ One of the file “austin.txt” is provided below.
PRODUCT SALES
CPU 18609.67
Motherboard 9031.26
Case 12797.59
Storage 2086.99
Monitor 5464.43
Graphics_Cards 146.52
Laptop 4989.36
PC 14532.46
▪ Again, the purpose is to read each file and produce the total of eah product in the list. ▪ The result should be displayed on the console and printed into an output file called “report.txt”.
Helpful Hint
It would be helpful considering the folliwng points.
▪ The four files provided along with the project should be included in the Visaul Studio project you create where the “.cpp” file is located. There is no need to create the files and edit the input data. Once included, the files will be accessible directly as shown below.
ifstream inFile("austin.txt");
▪ Decalring global variables for each product item might be easier. ▪ When you process the input files, you should read the first line and discard it since it is a header.
Resoruces
Microsoft Input and Output
https://docs.microsoft.com/en-us/cpp/c-runtime-library/input-and-output?view=vs-2019
https://docs.microsoft.com/en-us/cpp/standard-library/basic-fstream-class?view=vs-2019
https://docs.microsoft.com/en-us/cpp/standard-library/iostream?view=vs-2019
Requirement
1. Use the Visual Studio IDE to edit and build the program. 2. Please use the Google C++ Coding Convention provided below.
https://google.github.io/styleguide/cppguide.html
Ensure that the source code is formatted and documented properly. 4. Submit the Visual Studio project of your work in zip format at http://eagleonline.hccs.edu