Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hello this is my code i need a letle help in c++ i need my output like the one inside the red circle mind is

image text in transcribed

hello this is my code i need a letle help in c++ i need my output like the one inside the red circle mind is the last one and this is the code:

using namespace std; #include #include #include #include #include #include #include

class Student{ private: vector split(const string& str, const string& delim) { vector tokens; size_t prev = 0, pos = 0; do { pos = str.find(delim, prev); if (pos == string::npos) pos = str.length(); string token = str.substr(prev, pos-prev); if (!token.empty()) tokens.push_back(token); prev = pos + delim.length(); } while (pos tokens = split(str , " "); firstName = tokens.at(0); lastName = tokens.at(1); test1 = atoi(tokens.at(2).c_str()); test2 = atoi(tokens.at(3).c_str()); test3 = atoi(tokens.at(4).c_str()); test4 = atoi(tokens.at(5).c_str()); grade = (test1 + test2 + test3 + test4) / 4.0; } bool operator

class StudentReport{ public: vector students; float min, max, sum; void readFile(){ min = 100; max = 0; sum = 0; ifstream file( "students.txt" ); string str, file_contents; while (getline(file, str)) { file_contents += str; file_contents.push_back(' '); Student s(str); students.push_back(s); if(min > s.grade) min = s.grade; if(max

students.txt

Daryl Dixon 89 95 90 99 Rick Grimes 92 96 85 100 Glenn Rhee 94 99 97 95 Maggie Greene 85 82 94 90 Carl Grimes 75 84 92 89 Carol Peletier 84 91 89 95 Beth Greene 75 82 89 81 Sasha Williams 79 84 90 95 Tara Chambler 81 74 95 91 Rosita Espinosa 88 90 93 92 Eugene Porter 96 98 100 95 
Last Name Chambler Dixon Espinosa Greene Greene Grimes Grimes Peletier Porter Rhee Williams First Name Tara Daryl Rosita Maggie Beth Carl Rick Carol Eugene Glenn Sasha Test 1 Test 2 Test 3 Test 4 Grade 81.074.0 95.0 91.0 85.2 89.095.0 90.0 99.0 93.2 88.090.0 93.0 92.0 90.8 85.082.0 94.0 90.087.8 75.0 82.089.0 81.0 81.8 75.0 84.0 92.0 89.085.0 92.0 96.0 85.0 100.0 93.2 84.0 91.0 89.0 95.089.8 96.0 98.0 100.0 95.0 97.2 94.0 99.0 97.0 95.0 96.2 79.0 84.0 90.0 95.0 87.0 Mean = 898 Min = 81.8 Max = 97 2 Test 1 Test 2 Test 3 Test 4 Grade Last Name Chambler Dixon Espinosa Greene Greene Grimes Grimes Peletier Porter Rhee Williams Mean 89.8 Min 81 . 8 Max97.3 First Name Tara Daryl Rosita Maggie Beth Carl Rick Carol Eugene Glenn Sasha 81.0 74.0 95.0 91.085.3 89.095.0 90.0 99.0 93.3 88.090.0 93.0 92.090.8 85.082.0 94.0 90.0 87.8 75.0 82.0 89.0 81.081.8 75.0 84.0 92.089.085.0 92.096.085.0100.093.3 I 84.091.0 89.0 95.089.8 96.0 98.0 100.0 95.0 97.3 94.099.0 97.0 95.096.3 79.0 84.0 90.0 95.0 87.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

3:38 3:38 Today Edit 3:38 PM

Answered: 1 week ago

Question

3. What should a contract of employment contain?

Answered: 1 week ago

Question

1. What does the term employment relationship mean?

Answered: 1 week ago