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...

1 answer below »
3 projects due in 48 hours


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 https://visualstudio.microsoft.com/free-developer-offers/ https://mva.microsoft.com/en-US/training-courses/getting-started-with-visual-studio-2017-17798?l=9oIw0FD6D_3611787171 https://mva.microsoft.com/en-US/training-courses/getting-started-with-visual-studio-2017-17798?l=9oIw0FD6D_3611787171 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 3. 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 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 https://google.github.io/styleguide/cppguide.html http://eagleonline.hccs.edu/ Project Assignment I Course: COSC 1436 (C++) Term: Mode: F2F Instructor: Abass Alamnehe Purpose: Process COVID 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 https://visualstudio.microsoft.com/free-developer-offers/ https://mva.microsoft.com/en-US/training-courses/getting-started-with-visual-studio-2017-17798?l=9oIw0FD6D_3611787171 https://mva.microsoft.com/en-US/training-courses/getting-started-with-visual-studio-2017-17798?l=9oIw0FD6D_3611787171 Project Objective The tasks for this project involve reading a set of data from an input file, calculating percentage, determining the population from the given data, and displaying the result to the console output. The input data is obtained from CDC COVID Data Tracker at the following website. By now, the actual numbers should change, so what is provided along with this project is an outdated data. https://www.cdc.gov/covid-data-tracker/#cases For the purpose of this project, the columns (fields) that were selected include State, Total Case, Total Death, and Total Death per 100k population. The file name for the data is “cdc_covid_data.txt”. You are to develop a C++ program to process the data and performing the following specific tasks. ▪ Read the data from the input file “cdc_covid_data.txt”. There are four fields-- State, Total Case, Total Death, and Total Death per 100k population. ▪ Calculate the percentage of the death rate per state. ▪ Determine the population of each state from the given data. ▪ Display the result on the console screen. The input data format is shown below partially. State Total Cases Total Death_100k AK 4259 28 4 AL 108433 1898 39 AR 52665 599 20 AS 0 0 0 AZ 193537 4506 63 CA 621562 11224 28 CO 53176 1896 33 CT 50897 4453 125 DC 13220 597 85 DE 16536 593 61 FL 567375 9452 44 FSM 0 0 0 https://www.cdc.gov/covid-data-tracker/#cases The output should include the calculated result as shown below partially. Project Learning Outcomes At the end of the project, the expected learning outcomes: ▪ Analyze and develop solution. ▪ Write formatted code with proper documentation. ▪ Declare initialized variables and objects. ▪ Use proper data types for declarations. ▪ Write expressions to solve problems. ▪ Perform input/output operations on console. ▪ Perform file input/output operations. ▪ Integrate error checking mechanism in the code. ▪ Build, test, and run programs. Note: Helpful code sample is provided along with this project assignment. The sample is in Visual Studio project format as well as a plain source code. State Total Cases Total Death Death_100k Death_100k % Population AK 4259 28 4 14 700000 AL 108433 1898 39 2 4866667 AR 52665 599 20 3 2995000 AS 0 0 0 0 0 AZ 193537 4506 63 1 7152381 CA 621562 11224 28 0 40085714 CO 53176 1896 33 2 5745455 CT 50897 4453 125 3 3562400 DC 13220 597 85 14 702353 DE 16536 593 61 10 972131 FL 567375 9452 44 0 21481818 FSM 0 0 0 0 0 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 3. 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 Note Along with this project assignment, a code that demonstrates how to read data from an input file is provided. It uses a different data set for the input file. The code sample is intended to be an example with best practices. It is not however, designed to force you how you should design and solve the project. There are two functions--processCOVIDData() and main(). The main function is where the program starts execution. Without the main function, the program cannot run as a standalone application. The processCOVIDData() function demonstrates that a problem should be divided into manageable smaller pieces and use functions to solve them. An input data stream could be a file, a network connection, or a standard input device, such as keyboard. C++ provides a set of libraries to perform file input/output. ▪ In C++, a file must be represented by an ifstream object for any operation. Please note that in the C programming language, a different library is used. ▪ Reading is performed using the istream object. ▪ The ifstream class supports all built-in data types. /* Create an ifstream object to read data from an input file. */ ifstream inFile(inputFileName); https://google.github.io/styleguide/cppguide.html http://eagleonline.hccs.edu/ ▪ If a problem involves repeatedly reading data from a file, we should use a suitable type of loop. In the example, a while loop is used to read the file. o The loop repeats if the inFile object knows there is more data from the input stream. o Each round reads and processes each line of data from the input file. o Each field in the line is read one at a time using proper variable. // Read the input file by looping until the end of the file. while ( !inFile.eof() ) { // Read county, total case, and total death. inFile >> county >> totalCase >> totalDeath; // Process the data here. // Write to output console screen cout< setw(20)="">< left="">< county="">< setw(15)="">< totalcase="">< setw(15)="">< totaldeath="">< endl; } project assignment course: cosc 1436 (c++) term: mode: instructor: abass alamnehe purpose: project ii assignment: c++ keywords 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 endl;="" }="" project="" assignment="" course:="" cosc="" 1436="" (c++)="" term:="" mode:="" instructor:="" abass="" alamnehe="" purpose:="" project="" ii="" assignment:="" c++="" keywords="" 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="">
Answered Same DayDec 13, 2021

Answer To: Project Assignment Course: COSC 1436 (C++) Term: Mode: Instructor: Abass Alamnehe Purpose: Project...

Sumit answered on Dec 14 2021
128 Votes
Aggregate Data/.vscode/settings.json
{
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"map": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp",
"iomanip": "cpp"
}
}
Aggregate Data/austin.txt
PRODUCT SALES
CPU 18609.67
Motherboard 9031.26
Case 12797.59
Storage 2086.99
Monitor 5464.43
Graphics_Cards ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here