Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

@Katsuri or anyone else, help with the issue discussed below: The program that w

ID: 3830754 • Letter: #

Question

@Katsuri or anyone else, help with the issue discussed below:

The program that was written below to be used for keeping track of textbooks required and recommended for classes and the cost of those textbooks( Heres the link in Chegg for the formats the instruction wanted: "https://www.chegg.com/homework-help/questions-and-answers/write-program-c-used-keeping-track-textbooks-required-recommended-classes-cost-textbooks-p-q21146933" ) , the code keeps doesn't work for case "GB" and "PB" when trying to run input test1.txt file for "GB", test2,txt file for "PB". Can anyone take a look at the code and see what can be causing the "GB" and "PB" part of the code to not work in the code when giving this whole test1.txt inputs below:

B 1234567890123 Programming for Programmers
D 1234567890123 D 01/2017
GB 1234567890123
B 9780128006450 Physically Based Rendering, Third Edition: From Theory to Implementation
D 9780128006450 D 11/2016
D 9780128006450 A Matt Pharr, Greg Humphreys
B 9781568814247 Real-Time Rendering, Third Edition
D 9781568814247 D 07/2008
D 9781568814247 A Tomas Akenine-Moller, Eric Haines
D 9781568814247 E 3
GB 9781568814247
GB 9780128006450
Q
q
quit

----------------------------------------- test2.txt:

B 1234567890123 Programming for Programmers
PB
B 9780128006450 Physically Based Rendering, Third Edition: From Theory to Implementation
B 9781568814247 Real-Time Rendering, Third Edition
PB
Q
q
quit

[Code]

#include <string>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <fstream>
#include "Books.h"
#include "Class.h"
#include "Course.h"

using namespace std;

int BookCounter = 0, CourseCounter = 0, ClassCounter = 0;

class Book {

   public:
       long isbn;
       std::string title;
       std::string author;
       int edition;
       std::string publicationDate;
       double newRate = -1;
       double usedRate = -1;
       double rentedRate = -1;
       double eRate = -1;
} * books[100];

class Class {
  
   public:
       struct Book* book;
       struct Course* course;
       int sectionNumber;
       bool required;
      
} * classes[100];

class Course {

   public:
       std::string deptCode;
       int courseNumber;
       std::string name;
} * course[100];

int GetBook(long newISBN)
{
for (int i = 0; i < BookCounter; i++) {
if (books[i]->isbn == newISBN) {
return i;
}
}
return -1;
}
int GetCourse(int courseNum, string dept)
{
for (int i = 0; i < CourseCounter; i++) {

if (course[i]->courseNumber == courseNum && course[i]->deptCode == dept) {
return i;
}
}
return -1;
}
void PrintBooks(string code, istringstream& iss)
{
string deptCode;
int sectionNum, courseNum;
long isbn;
if (code == "GC")
iss >> deptCode >> courseNum;
else if (code == "GS")
iss >> deptCode >> courseNum >> sectionNum;
else if (code == "GB")
       iss >> isbn;
//Problem occurs here, possible it never enters the loop, bc ClassCounter is set to 0?

for (int i = 0; i < ClassCounter; i++) {
if (code == "GB" && classes[i]->book->isbn == isbn) {
cout << classes[i]->book->isbn << " " << classes[i]->book->title << " ";
           if (classes[i]->required)
cout << " Required ";
else
cout << " Optional ";
}
else if (classes[i]->course->courseNumber == courseNum && classes[i]->course->deptCode == deptCode) {
if (code == "GS" && classes[i]->sectionNumber == sectionNum) {
cout << classes[i]->book->isbn << " " << classes[i]->book->title << " ";
if (classes[i]->required)
cout << " Required ";
else
cout << " Optional ";
}
if (code == "GC") {
cout << classes[i]->book->isbn << " " << classes[i]->book->title << " ";
if (classes[i]->required)
cout << " Required ";
else
cout << " Optional ";
}
}
}
}
void PrintAllInfo(string code, istringstream& iss)
{
if (code == "PB") {
for (int i = 0; i < BookCounter; i++) {
cout << books[i]->isbn << " " << books[i]->title << " " << books[i]->author << " Ed: " << books[i]->edition << " " << books[i]->publicationDate;
cout << " Rent Rate: " << books[i]->rentedRate << " New Rate: " << books[i]->newRate << " Used Rate: " << books[i]->usedRate;
cout << " Electronic Rate: " << books[i]->eRate << " ";
}
}
else if (code == "PC") {
for (int i = 0; i < CourseCounter; i++) {
cout << "Course Num: " << course[i]->courseNumber << " Dept Code: " << course[i]->deptCode << " Name: " << course[i]->name;
cout << " ";
}
}
else if (code == "PD") {
string deptCode;
iss >> deptCode;
for (int i = 0; i < ClassCounter; i++) {
if (classes[i]->course->deptCode == deptCode) {
cout << classes[i]->book->isbn << " " << classes[i]->book->title << " ";
}
}
}
else if (code == "PY") {
int pmonth, pyear, checkMonth, checkYear;
int ch;
iss >> checkMonth >> ch >> checkYear;
  
for (int i = 0; i < BookCounter; i++) {
istringstream isstreamer(books[i]->publicationDate);
isstreamer >> pmonth >> ch >> pyear;
if ((pyear == checkYear && pmonth > checkMonth) || (pyear > checkYear)) {
cout << books[i]->isbn << " " << books[i]->title << " ";
}
}
}
else if (code == "PM") {
double average = 0, max = 0, min = 100000;
int count = 1;
string deptCode;
iss >> deptCode;

for (int i = 0; i < ClassCounter; i++) {
if (classes[i]->course->deptCode == deptCode) {
average += classes[i]->book->usedRate == -1 ? 0 : classes[i]->book->usedRate;
average += classes[i]->book->newRate == -1 ? 0 : classes[i]->book->newRate;
average += classes[i]->book->rentedRate == -1 ? 0 : classes[i]->book->rentedRate;
average += classes[i]->book->eRate == -1 ? 0 : classes[i]->book->eRate;

if (classes[i]->book->usedRate != -1) {
if (classes[i]->book->usedRate > max)
max = classes[i]->book->usedRate;
if (classes[i]->book->usedRate < min && classes[i]->required)
min = classes[i]->book->usedRate;
count++;
}
if (classes[i]->book->newRate != -1) {
if (classes[i]->book->newRate > max)
max = classes[i]->book->newRate;
if (classes[i]->book->newRate < min && classes[i]->required)
min = classes[i]->book->newRate;
count++;
}
if (classes[i]->book->rentedRate != -1) {
if (classes[i]->book->rentedRate > max)
max = classes[i]->book->rentedRate;
if (classes[i]->book->rentedRate < min && classes[i]->required)
min = classes[i]->book->rentedRate;
count++;
}
if (classes[i]->book->eRate != -1) {
if (classes[i]->book->eRate > max)
max = classes[i]->book->eRate;
if (classes[i]->book->eRate < min && classes[i]->required)
min = classes[i]->book->eRate;
count++;
}
}
}

cout << "Average: " << average / count << " Min Cost: " << min << " Max Cost: " << max << endl;
}
}
int main()
{
cout << "Enter 'quit' To quit The Program ";
//change the test files here
ifstream infile("test_input_02.txt");
  
for (string line; getline(infile, line);) {
if (line == "quit")
exit(0);
else {
string Code;
string deptCode;
istringstream Iss(line);
Iss >> Code;
long NewISBN = 0;
int BookIndex = 0;
char UpdateCode;

switch (Code.at(0)) {
case 'B':
books[BookCounter] = new Book;
Iss >> books[BookCounter]->isbn;
books[BookCounter]->title = Iss.str().substr(Iss.tellg());
BookCounter++;
break;
case 'D':
Iss >> NewISBN;
BookIndex = GetBook(NewISBN);
Iss >> UpdateCode;
if (UpdateCode == 'A')
books[BookIndex]->author = Iss.str().substr(Iss.tellg());
else if (UpdateCode == 'E')
Iss >> books[BookIndex]->edition;
else
Iss >> books[BookIndex]->publicationDate;
break;
case 'M':
Iss >> NewISBN;
double cost;
BookIndex = GetBook(NewISBN);
Iss >> cost >> UpdateCode;
if (UpdateCode == 'N')
books[BookIndex]->newRate = cost;
else if (UpdateCode == 'U')
books[BookIndex]->usedRate = cost;
else if (UpdateCode == 'R')
books[BookIndex]->rentedRate = cost;
else if (UpdateCode == 'E')
books[BookIndex]->eRate = cost;
break;
case 'C':
course[CourseCounter] = new Course;
Iss >> course[CourseCounter]->deptCode >> course[CourseCounter]->courseNumber;
course[CourseCounter]->name = Iss.str();
CourseCounter++;
break;
case 'A':
Iss >> NewISBN;
int courseNum, courseIndex;
Iss >> deptCode >> courseNum;
courseIndex = GetCourse(courseNum, deptCode);
BookIndex = GetBook(NewISBN);
classes[ClassCounter] = new Class;
classes[ClassCounter]->book = books[BookIndex];
classes[ClassCounter]->course = course[courseIndex];
Iss >> classes[ClassCounter]->sectionNumber;
Iss >> classes[ClassCounter]->required;
ClassCounter++;
break;
case 'G':
PrintBooks(Code, Iss);
break;
case 'P':
PrintAllInfo(Code, Iss);
break;
}
}
}
}

[/EndCode]

Also is it possible to take in multiple files, instead one by one, when you have say 3-4 other test files? Thanks.

Explanation / Answer

main.cpp

#include <iostream>
#include "book.h"
#include "course.h"
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>

using namespace std;

// Splits string at whitespace and returns vector of all entries
vector<string> split(string to_split) {
vector<string> to_return;
string buffer;

stringstream ss(to_split);

while(ss >> buffer) {
    buffer.erase(remove(buffer.begin(), buffer.end(), ' '), buffer.end());
    to_return.push_back(buffer);
}

return to_return;
}

// Returns index of book in book list
int book_index_by_isbn(vector<book> book_list, string ISBN_in) {
for (int i = 0; i < book_list.size(); i++)
    if (book_list[i].ISBN == ISBN_in)
      return i;

return -1;
}


int main() {
bool running_format = true;
vector<book> book_list;
vector<course> course_list;

while (running_format) {
    string input;

    getline(cin, input);

    // Checking input and displaying if not empty
    if (input == "") {
      cout << " Exiting on no input ";
      break;
    } else {
      cout << " Input~> " << input;
    }

    // Seperates input at first space to get char_code
    string char_code = input.substr(0, input.find_first_of(' '));
    // Cutting off char_code
    input = input.substr(input.find_first_of(' ')+1, input.size()-1);

    if (char_code == "B") {
// Defining book
// B <ISBN> <Title>
      // Cutting off ISBN after finding
      string ISBN = input.substr(0, input.find_first_of(' '));
      input = input.substr(input.find_first_of(' ')+1, input.size()-1);

      if (book_index_by_isbn(book_list, ISBN) < 0) {
        string Title = input;

        // Pushing book into list
        book_list.push_back(book(ISBN, Title));

      } else {
        cout << " ISBN already exists ";
      }

    } else if (char_code == "D") {
// Defining characteristic
// D <ISBN> <A | E | D> <value>
      vector<string> elements = split(input);

      // Checking input
      if (elements.size() < 3) {
        cout << " Malformed input ";
      } else {

        int book_index = book_index_by_isbn(book_list, elements[0]);
        if (book_index < 0) {
          cout << " Book with ISBN doesn't exist ";

        } else if (elements[1] == "A") {
          // Author
          string author_sum;

          for (int i = 2; i < elements.size(); i++)
            author_sum += elements[i] + " ";

          book_list[book_index].author = author_sum;
        } else if (elements[1] == "E") {
          // Edition
          int edition_converted = atoi(elements[2].c_str());

          book_list[book_index].edition = edition_converted;
        } else if (elements[1] == "D") {
          // Date
          book_list[book_index].set_date(elements[2]);
        }
      }

    } else if (char_code == "M") {
// Defining cost and format
// M <ISBN> <Cost> <N | U | R | E>
      vector<string> elements = split(input);

      // Checking input    
      if (elements.size() != 3) {
        cout << " Malformed input ";
      } else {

        int book_index = book_index_by_isbn(book_list, elements[0]);
        if (book_index < 0) {
          cout << " Book with ISBN doesn't exist ";

        } else {
          double cost_converted = atof(elements[1].c_str());
          book_list[book_index].set_cost(cost_converted, elements[2][0]);
        }
      }

    } else if (char_code == "C") {
// Defining course
// C <Department Code> <Course Number> <Name>
      // Finding needed variables
      vector<string> elements = split(input);

      // Checking input    
      if (elements.size() < 3) {
        cout << " Malformed input ";
      } else {

        string name_sum;
        for (int i = 2; i < elements.size(); i++) {
          name_sum += elements[i] + " ";
        }

        int course_num = atoi(elements[1].c_str());

        // Pushing course into list
        course_list.push_back(course(elements[0], course_num, name_sum));
      }

    } else if (char_code == "A") {
// Assign book to class
// A <ISBN> <Department Code> <Course Number> <Section Number> <R | O>
      vector<string> elements = split(input);

      // Checking input    
      if (elements.size() != 5) {
        cout << " Malformed input ";
      } else {

        // Getting and checking book
        int book_index = book_index_by_isbn(book_list, elements[0]);
        if (book_index < 0) {
          cout << " Book with ISBN doesn't exist ";
      
        } else {
          for (int i = 0; i < course_list.size(); i++) {
            if ((course_list[i].department_code == elements[1]) and
              (course_list[i].course_num == atoi(elements[2].c_str()))) {

              course_list[i].add_book(&book_list[book_index], atoi(elements[3].c_str()), elements[4][0]);
            }
          }
        }
      }

    } else if (char_code == "GC") {
// Print books for course
// GC <Department Code> <Course Number>
      vector<string> elements = split(input);

      // Checking input    
      if (elements.size() != 2) {
        cout << " Malformed input ";
      } else {

        for (int i = 0; i < course_list.size(); i++)
          if ((course_list[i].department_code == elements[0]) and
              (course_list[i].course_num == atoi(elements[1].c_str())))
            course_list[i].print_books();
      }

    } else if (char_code == "GS") {
// Print books for course with specific section number
// GS <Department Code> <Course Number> <Section Number>
      vector<string> elements = split(input);
    
      // Checking input    
      if (elements.size() != 3) {
        cout << " Malformed input ";
      } else {

        for (int i = 0; i < course_list.size(); i++) {
          if ((course_list[i].department_code == elements[0]) and
          (course_list[i].course_num == atoi(elements[1].c_str()))) {
            course_list[i].print_books_w_section(atoi(elements[2].c_str()));
          }
        }
      }

    } else if (char_code == "GB") {
// Print info on book by ISBN
// GB <ISBN>
      // stripping whitespace when needed
      input.erase(remove(input.begin(), input.end(), ' '), input.end());

      int book_index = book_index_by_isbn(book_list, input);
      if (book_index < 0) {
        cout << " Book with ISBN doesn't exist ";

      } else {
        book_list[book_index].print();
      }

    } else if (char_code == "PB") {
// Print list of all books defined
// PB
      for (int i = 0; i < book_list.size(); i++) {
        book_list[i].print();
      }

    } else if (char_code == "PC") {
// Print list of all classes defined
// PC
      for (int i = 0; i < course_list.size(); i++) {
        course_list[i].print_course_info();
      }

    } else if (char_code == "PY") {
// Print all books with publication date at value or later
// PY <MM/YYYY>
      // stripping whitespace when needed
      input.erase(remove(input.begin(), input.end(), ' '), input.end());

      // Getting year and month from input
      string month_temp = input.substr(0, input.find("/"));
      int month_given = atoi(month_temp.c_str());

      string year_temp = input.substr(input.find("/")+1, input.size()-1);
      int year_given = atoi(year_temp.c_str());

      // Getting everything that is above given date
      for (int i = 0; i < book_list.size(); i++) {
        int month_book = book_list[i].date_published.first;
        int year_book = book_list[i].date_published.second;

        if ((year_given == year_book) and (month_given <= month_book)) {
          book_list[i].print();
        } else if (year_given < year_book) {
          book_list[i].print();
        }
      }

    } else if (char_code == "PD") {
// Print courses with given Department_code
// PD <Department Code>
      for (int i = 0; i < course_list.size(); i++) {
        if (course_list[i].department_code == input) {
          course_list[i].print_course_info();
        }
      }

    } else if (char_code == "PM") {
// Average and min and max costs by department_code
// PM <Department Code>
      // stripping whitespace when needed
      input.erase(remove(input.begin(), input.end(), ' '), input.end());

      double running_max = 0.0;
      double running_min;
      double sum = 0.0;
      vector<double> for_average;
    
      // Populating vector with cost of all books in the Department
      for (int i = 0; i < course_list.size(); i++) {
        if (course_list[i].department_code == input) {
          vector<double> temp = course_list[i].get_book_costs();
          for_average.insert(for_average.end(), temp.begin(), temp.end());
        }
      }

      // Getting average, max, min
      if (for_average.size() > 0) {
        running_min = for_average[0];
        for (int i = 0; i < for_average.size(); i++) {
          if (for_average[i] > running_max) {
            running_max = for_average[i];
          }

          if (for_average[i] < running_min) {
            running_min = for_average[i];
          }

          sum += for_average[i];
        }

        double average = sum / for_average.size();

        cout << " For Department: " << input;
        cout << " Average: " << fixed << setprecision(2) << average;
        cout << " Min: " << running_min;
        cout << " Max: " << running_max << endl;
      } else {
        // Vector of all costs is empty
        cout << " Nothing to calculate for " << input << endl;
      }

    } else if (char_code == "exit") {
      cout << " Exiting... ";
      break;
    }
}

return 0;
}


book.cpp
#include <stdlib.h>
#include "book.h"


// Setting date into date pair object
void book::set_date(string date_in) {
string month_temp = date_in.substr(0, date_in.find("/"));
int month = atoi(month_temp.c_str());

string year_temp = date_in.substr(date_in.find("/")+1, date_in.size()-1);
int year = atoi(year_temp.c_str());

date_published = make_pair(month, year);
}

// Set cost by format
void book::set_cost(double cost_in, char format) {
if (format == 'N') {
    cost_n = cost_in;
} else if (format == 'U') {
    cost_u = cost_in;
} else if (format == 'R') {
    cost_r = cost_in;
} else if (format == 'E') {
    cost_e = cost_in;
}
}

double book::get_cost_average() {
// Sum of all defined costs above 0.0
double sum = 0.0;
int count = 0;

if (cost_n > 0.0) {
    sum += cost_n;
    count++;
} else if (cost_u > 0.0) {
    sum += cost_u;
    count++;
} else if (cost_r > 0.0) {
    sum += cost_r;
    count++;
} else if (cost_e > 0.0) {
    sum += cost_e;
    count++;
}

return sum / count;
}

// Print known book info
void book::print() {
cout << " ISBN: " << ISBN;
cout << " Title: " << title;

// If statments for variable that has to be defined
if (author == "") {
    cout << " Author: N/A";  
} else {
    cout << " Author: " << author;
}

if (edition == 0) {
      cout << " Edition: N/A";
} else {
    cout << " Edition: " << edition;
}

if ((date_published.first == 0) and (date_published.second == 0)) {
    cout << " Published: N/A";
} else {
    cout << " Published: " << date_published.first << "/" << date_published.second;
}

if (cost_n != 0.0) {
    cout << " Cost for New: $" << fixed << setprecision(2) << cost_n;
}

if (cost_u != 0.0) {
    cout << " Cost for Used: $" << fixed << setprecision(2) << cost_u;
}

if (cost_r != 0.0) {
    cout << " Cost for Rent: $" << fixed << setprecision(2) << cost_r;
}

if (cost_e != 0.0) {
    cout << " Cost for Electronic: $" << fixed << setprecision(2) << cost_e;
}

cout << endl;
}

book.h

#ifndef _book_h_
#define _book_h_


#include <string>
#include <vector>
#include <iostream>
#include <iomanip>

using namespace std;

class book {
public:
string ISBN = "";   // Accounting for limit to int size
string title = "";

string author = "";
int edition = 0;

// Maybe change to new object date type
pair<int, int> date_published;

// Cost for each format
double cost_n = 0.0;
double cost_u = 0.0;
double cost_r = 0.0;
double cost_e = 0.0;

book(string ISBN_in, string title_in) {
    ISBN = ISBN_in;
    title = title_in;
}

void set_author(string author_in) {
    author = author_in;
}

void set_edition(int edition_in) {
    edition = edition_in;
}

// Setting date into date pair object
void set_date(string date_in);

// Set cost by format
void set_cost(double cost_in, char format);

// Sum of all defined costs above 0.0
double get_cost_average();

// Print book known info
void print();
};


#endif

course.cpp

#include "course.h"


// Adding book by reference to a section. Also checking for previous section definition
void course::add_book(book* book_in, int section_number_in, char necessity) {
map<int, section>::iterator it;

it = section_map.find(section_number_in);
if (it != section_map.end()) {
    // Section already exists
    if (section_map[section_number_in].has_book(book_in)) {
      cout << " Book already exists in this location ";
      return;
    }

    if (necessity == 'R') {
      section_map[section_number_in].books_required.push_back(book_in);
    } else if (necessity == 'O') {
      section_map[section_number_in].books_optional.push_back(book_in);
    }
} else {
    // Create new section
    section sec_temp;

    if (necessity == 'R') {
      sec_temp.books_required.push_back(book_in);
    } else if (necessity == 'O') {
      sec_temp.books_optional.push_back(book_in);
    }

    // Placing section in
    section_map.insert(pair<int, section>(section_number_in, sec_temp));
}
}

void course::print_course_info() {
cout << " Department code: " << department_code;
cout << " Course_num: " << course_num;
cout << " Name: " << name << endl;
}

// Print all books in all sections
void course::print_books() {
for (map<int, section>::iterator it = section_map.begin(); it != section_map.end(); it++) {
    cout << " Section " << it->first << ":";
    print_books_w_section(it->first);   // Uses general print by section
}
}

// Print books in section
void course::print_books_w_section(int section_number_in) {
map<int, section>::iterator it;

it = section_map.find(section_number_in);
if (it != section_map.end()) {
    // If given section exists

    // Those required
    if (section_map[section_number_in].books_required.size() > 0) {
      cout << " Required: ";
      for (int i = 0; i < section_map[section_number_in].books_required.size(); i++) {
        section_map[section_number_in].books_required[i]->print();
      }
    } else {
      cout << " None listed as required. ";
    }

    // Those optional
    if (section_map[section_number_in].books_optional.size() > 0) {
      cout << " Optional: ";
      for (int i = 0; i < section_map[section_number_in].books_optional.size(); i++) {
        section_map[section_number_in].books_optional[i]->print();
      }
    } else {
      cout << " None listed as optional. ";
    }
} else {
    cout << " No such section " << section_number_in << " exists ";
}
}

// Returns vector of all book costs in all sections for PM command
vector<double> course::get_book_costs() {
vector<double> to_return;

// Sums every book within this course
for (map<int, section>::iterator it = section_map.begin(); it != section_map.end(); it++) {
    for (int i = 0; i < it->second.books_required.size(); i++) {
      to_return.push_back(it->second.books_required[i]->get_cost_average());    // All sections required books
    }

    for (int i = 0; i < it->second.books_optional.size(); i++) {
      to_return.push_back(it->second.books_optional[i]->get_cost_average());    // All sections optional books
    }
}

return to_return;
}

course.h

#ifndef _course_h_
#define _course_h_


#include <utility>
#include <string>
#include "book.h"
#include "section.h"
#include <vector>
#include <iostream>
#include <map>

using namespace std;

class course {
public:
string department_code = "";
int course_num = 0;
string name = "";

map<int, section> section_map;    // Finding element: it = section_map.find() if(!it = section_map.end())

course(string department_code_in, int course_num_in, string name_in) {
    department_code = department_code_in;
    course_num = course_num_in;
    name = name_in;
}

// Adding book by reference to a section. Also checking for previous section definition
void add_book(book* book_in, int section_number_in, char necessity);

void print_course_info();

// Prints all sections
void print_books();

void print_books_w_section(int section_number_in);

// Returns vector of all book costs in all sections for PM command
vector<double> get_book_costs();
};


#endif

second.h

#ifndef _section_h_
#define _section_h_


#include <string>
#include "book.h"
#include <vector>
#include <iostream>

class section {
public:
// Vectors of pointers to books in main
vector<book*> books_required;
vector<book*> books_optional;

// If book exists in either required or optional
bool has_book(book* book_in) {
    for (int i = 0; i < books_required.size(); i++) {
      if (books_required[i] == book_in) {
        return true;
      }
    }

    return false;
}
};


#endif

test_input.txt

B 1234567890123 Programming for Progs
B 1234567890124 Programming for Dogs
B 1234567890125 Programming for Cats
D 1234567890123 D 01/2017
D 1234567890123 A King of Hell
D 1234567890123 E 5
D 1234567890124 D 04/2017
D 1234567890124 A Styxx
D 1234567890124 E 2
D 1234567890125 D 02/2017
D 1234567890125 A Anaxkolasi
D 1234567890125 E 3
M 1234567890123 1 N
M 1234567890123 1 U
M 1234567890123 1 R
M 1234567890123 1 E
M 1234567890124 1 N
M 1234567890124 1 U
M 1234567890124 1 E
M 1234567890124 1 R
M 1234567890125 1 N
M 1234567890125 1 U
M 1234567890125 1 R
M 1234567890125 1 E
C CSCE 315 Programming Studio
C CSCE 313 Unix Systems
A 1234567890123 CSCE 315 501 R
A 1234567890123 CSCE 315 502 R
A 1234567890123 CSCE 315 503 R
A 1234567890124 CSCE 313 604 R
A 1234567890124 CSCE 313 607 R
A 1234567890124 CSCE 313 603 R
A 1234567890125 CSCE 315 501 R
A 1234567890125 CSCE 315 502 R
A 1234567890125 CSCE 315 503 R
GC CSCE 315
GS CSCE 315 503
GC CSCE 313
GS CSCE 313 607
GB 1234567890123
GB 1234567890124
GB 1234567890125
PB
PC
PY 01/2017
PY 03/2017
PD CSCE
PM CSCE

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote