Question: IN C++ The purpose of this program is a write a program that reads in score records from standard input and outputs such to standard
IN C++

The purpose of this program is a write a program that reads in score records from standard input and outputs such to standard output as follows: each score record is composed of a first name, last name, and score each field and record is delimited by whitespace o i.e., in particular, first and last names cannot contain whitespace each score is an unsigned integer Your program is to read in as many score records as is possible, i.e., keep reading score records until an end-of-file or the stream fails, or goes bad. After each record is read in, write it out immediately to standard output as follows: each record output must be followed by a newline character, between each field written must be a single space, and, the fields must be written out in this order: first name, last name, score. The score record must be declared as follows: struct score 1. 2. 3 { std::string first_name_; std::string last_name_; unsigned int score_; }; 5. and you must write suitable IOStream operator overloads to read from std::cin and write to std::cout each score. To help you with this, see the p3.cxx program from the lecture (which is also linked to below) and model your code after the code in that program. (NOTE: These overloads are the ONLY functions you can access any of the members of score.) Remember to #include all needed #include files, etc. Your program must be a valid C++20 program and you are not allow to use any C- language methods to accomplish the same. Sample Program Input File Consider this input file a1-input.dat: 1. 2. 3. $ cat al-input.dat charlie brown 56 sally brown 63 lucy van_pelt 89 linus van_pelt 67 snoppy dog 100 woodstock bird 112 $ 5. 6. 7. 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
