I need this project in C++, amd for the data files I don\'t know how to upload t
ID: 3672230 • Letter: I
Question
I need this project in C++, amd for the data files I don't know how to upload them. Or if you can just create the project and i will teat them with the files after CSCI 13500. Programming Assignment 1. DUE: 11:59pm Sunday Feb. 28h In this project you will take grade and course data from two files, combine it into a third file. And then create a fourth file of summary data. Your program will work with actual data: All courses and grades taken by any Hunter student who was a declared CS major in Fall of 2012 (names have been removed and empl IDs scrambled, so the data is anonymous). The Data The two data files are StudentData.tsvand HunterCourses.tsv. Both files are tab- delimited ghence the tsv extension - tab separated values). And the data is structured so that you do not, actually you SHOULDN'T, have to use getline for your project StudentData.tsv (SD) contains student grade data, and HunterCourses.tsv (HC) contains data about individual courses. SD contains 6378 lines, Each line corresponds to a student taking a course. Here are some example lines: 20424297 1136 AFPRL 10200 20424297 1139 CSCI 20424297 1142 PSYCH 16000 18000 A+ 1 W -1 20424297 1142 PSYCH 22000 w -1 20608974 1082 BLOCK 20608974 1082 CHEM 10000 102LC XX 1 B+ 3.3 The first column is the student's CUNYFirst Empl ID, the second column is a code for the semester they took the course, the third column is the subject code, the fourth column is the catalog code (most times it is a number, but sometimes there are letters in the code), the fifth column is the letter grade received and the sixth columrn is the numeric equivalent of the letter grade. The file is sorted by Empl ID Some notes on the example lines: .Student 20424297 took four courses AFPRL 10200, CSCI 16000, PSYCH . You need to read all the data items, however you will only need to use the . When asked to calculate a GPA, numeric grades of -1 should be ignored 18000 and PSYCH 22000. Student 20608974 took two classes BLOCK 10000 and CHEM 102LC. Empl ID, Subject, Catalog Number and Numeric Grade.Explanation / Answer
Assignment1.cpp
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
//Part 1; assigning each class a student has taken credit hour/designation value based on Course data
int main()
{
ifstream StudentDataInstream, HunterCourseInstream, SDPlusInstream;
ofstream DataPlusostream, Summaryostream;
StudentDataInstream.open("StudentData.tsv");
DataPlusostream.open("StudentDataPlus.tsv");
int empl, semester;
string sd_dept, hc_dept, grade, designation, sd_code, hc_code;
double sd_weight, hc_hours;
while(StudentDataInstream>>empl>>semester>>sd_dept>>sd_code>>grade>>sd_weight)
{
HunterCourseInstream.open("HunterCourses.tsv");
while(HunterCourseInstream >> hc_dept >> hc_code >> hc_hours >> designation)
{
if((hc_dept == sd_dept) && (hc_code == sd_code))
{
break;
}
hc_hours = 3.0;
designation = "RNL";
}
HunterCourseInstream.close();
DataPlusostream << empl<<" "<< semester<<" "<<sd_dept<<" "<<sd_code<<" "<< grade<<" "<<sd_weight<<" "<<hc_hours<<" "<<designation<<endl;
}
//End of part 1.
//Part 2: Calculating a students GPA based on the data given in the StudentDataPlus.tsv file.
//Formula to Calculate GPA: (Sum of (number grade* contact hours))/total credits
SDPlusInstream.open("StudentDataPlus.tsv");
Summaryostream.open("StudentSummary.tsv");
int pre_empl = 0;
double class_credit = 0.0, credits_attempted = 0.0, total_credit = 0.0, final_gpa = 0.0, nl_percentage = 0.0, csci_gpa = 0.0;
while(SDPlusInstream >> empl >> semester >> hc_dept >> hc_code >> grade >> sd_weight >> hc_hours >> designation)
{
if (sd_weight == -1.0)
{
sd_weight = 0.0;
}
class_credit = (sd_weight*hc_hours);
credits_attempted = credits_attempted + class_credit;
total_credit = total_credit + hc_hours;
final_gpa = credits_attempted/total_credit;
{
Summaryostream << empl<< " " << final_gpa<<" "<<csci_gpa<<" "<<nl_percentage<<endl;
if(1 < 0 )
{
class_credit = 0.0;
credits_attempted = 0.0;
total_credit = 0.0;
final_gpa = 0.0;
nl_percentage = 0.0;
csci_gpa = 0.0;
pre_empl = empl;
}
}
}
cout << "Good to go!";
return 0;
}
StudentData.tsv
20424297 1092 CSCI 13500 B 3
20424297 1092 CSCI 13600 A- 3.7
20424297 1092 FREN 10100 B 3
20424297 1096 FREN 10200 W -1
20424297 1099 CSCI 23500 NC -1
20424297 1102 FREN 10200 B- 2.7
20424297 1109 PSYCH 10000 B 3
20424297 1112 FREN 20100 C+ 2.3
20424297 1119 AFPRL 24300 A 4
20424297 1122 PSYCH 17000 B- 2.7
20424297 1129 CLA 20300 B+ 3.3
HunterCourses.tsv
17 250 3.00 RNL
17 381 3.00 RLA
20 201 3.00 RNL
20 202 3.00 RNL
42 102LC 3.00 RNL
45 51 1.00 RNL
51 121 3.00 RNL
51 122 3.00 RNL
54 101 3.00 RNL
56 111 3.00 RNL
56 260 3.00 RNL
56 301 3.00 RNL
56 302 3.00 RNL
56 490 3.00 RLA
57 201 3.00 RNL
ACC 22500 3.00 RNL
ACC 23000 3.00 RNL
ACC 27100 3.00 RNL
ACC 27200 3.00 RNL
ACC 28000 3.00 RNL
ACC 36700 3.00 RNL
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.