You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed You are an unnamed TA attending Professor Rizk's meeting. She always catches you getting distracted so she decides to make you write a program for her to sort out your thoughts whenever she catches you on your phone. You may have a short attention span but you are a clever TA. Your students are free labor. You will get them to write their program for you or you will fail them and Professor Rizk will never ever find out. Professor Rizk is so cool -> Huh? What did Professor Rizk say? -> Say something she is getting mad -> Neck on froze (huh huh) -> Cool A/C air blowing down my neck This is your train of thought. They are linked together. Normally, the last sentence of one thought should be the first sentence of the next consecutive thought. However, these thoughts are scrambled up. This is what it looks like when you sort out your thoughts. Professor Rizk is so cool -> Cool A/C air blowing down my neck -> Neck on froze (huh huh) -> Huh? What did Profesor Rizk say? -> Say something she is getting mad During lab, you will give your students a text files containing your thoughts and they will output your thoughts in a connected, sorted order. Input (MUST MATCH) Professor Rizk is so cool Huh? What did Professor Rizk say? Say something she is getting mad Neck on froze (huh huh) Cool A/C air blowing down my neck Output/sunny input-input1.txt output-outputl.txt Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Input (MUST MATCH) Neck fly as a jet Keep a gold chain on my neck. Jet boy better treat me with With respect Output/sunny input-inputl.txt output-outputl.txt Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect Input (MUST MATCH) Recall some are dead, and some are living With lovers and friends, I still can recall Living in my life, I've loved them all my There are places I'll remember All Remain all these places had their moments with My life, though some have changed Some forever, not for better Better some have gone, and some remain All my life, though some have changed some Output/sunny input-input1.txt output-outputl.txt There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed. #include <map> #include <string> #include <iostream> #include <sstream> using namespace std; // This is a class that can parse the commnad line arguments we use in COSC 2430 homework. class ArgumentManager { private: map<string, string> m_argumentMap; public: Argument Manager () { } Argument Manager (int argc, char *argv[], char delimiter=';'); Argument Manager (string rawArguments, char delimiter=';'); void parse(int argc, char *argv[], char delimiter=';'); void parse (string rawArguments, char delimiter=';'); string get (string argumentName); string toString(); friend ostream& operator <<(ostream &out, <<(ostream &out, ArgumentManager &am); }; void ArgumentManager::parse (string rawArguments, char delimiter) { stringstream currentArgumentName; stringstream currentArgument Value; bool argument Name Finished = false; for (unsigned int i=0; i<=rawArguments.length(); i++) { if (i == rawArguments.length () 11 rawArguments [i] == delimiter) { if (currentArgumentName.str() != m_argumentMap [currentArgument Name.str()] = currentArgumentValue.str(); } // reset currentArgumentName.str(""); currentArgumentValue.str(""); argumentName Finished = false; } else if (rawArguments[i] == ¹=¹) { argumentName Finished = true; } else { if (argumentName Finished) { currentArgument Value << rawArguments[i]; spaces in argument names. } } else { (rawArguments[i] '') } // ignore any void } if currentArgument Name <<< rawArguments [i]; } == continue; void Argument Manager::parse (int argc, char *argv[], char delimiter) { if (argc > 1) { i++) { delimiter); } } } ArgumentManager::ArgumentMana ger (int argc, char *argv[], char delimiter) { for (int i=1; i<argc; parse (argv[i], parse (argc, argv, delimiter); } } Argument Manager::ArgumentMana ger (string rawArguments, char delimiter) { parse (rawArguments, delimiter); string me) ; ArgumentManager::get (string argumentName) { map<string, string>::iterator iter m_argumentMap.find (argument Na //If the argument is not found, return a blank string. if (iter == m_argumentMap.end()) { return ""; } } } else { } string Argument Manager::toString() { stringstream ss; for (map<string, string>::iterator iter = m_argumentMap.begin(); != m_argumentMap.end(); iter++) { ss << "Argument name: << iter->first << endl; ss << "Argument value: << iter->second << endl; } return ss.str(); } return iter->second; 11 iter ostream& operator << (ostream &out, Argument Manager &am) { out << am.toString(); return out; Professor Rizk is so cool Cool A/C air blowing down my neck Neck on froze (huh huh) Huh? What did Professor Rizk say? Say something she is getting mad Keep a gold chain on my neck Neck fly as a jet Jet boy better treat me with With respect There are places I'll remember All All my life, though some have changed some Some forever, not for better Better some have gone, and some remain Remain all these places had their moments with With lovers and friends, I still can recall Recall some are dead, and some are living Living in my life, I've loved them all my My life, though some have changed
Expert Answer:
Answer rating: 100% (QA)
Answer 1 The program can be written in any programming language The goal of the program is to take an input file containing a list of scrambled thoughts and output them in a connected sorted order The ... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Write a program for your graphing utility that graphs two vectors and their difference given the vectors in component form.
-
GPA Calculator (gpa_calculator.py) You've decided to build a program to track your Grade Point Average (GPA). Your program will prompt the user to enter information for each course attempted (eg....
-
Cas Experiment Graphing Write a program for graphing partial sums of the following series. Guess from the graph what f(x) the series may represent. Confirm or disprove your guess by using the...
-
Southern Stitches is a local casual clothing shop that makes a variety of t-shirt styles. Below is some actual vs. budget information for Southern's t-shirts for the month of May. Assume no...
-
What is innovation? What innovation advantages do all multinational firms have? What disadvantages to SMEs have relative to large multinational enterprises for innovation?
-
On July 1, a petty cash fund was established for $100.00. The following vouchers were issued during July: REQUIRED 1. Prepare the journal entry to establish the petty cash fund. 2. Record the...
-
Every day, logistics companies such as United Parcel Service (UPS) must decide how to route their trucks, that is, the order in which to deliver the packages that have been loaded on a truck. UPS...
-
Mayville is a rural village with a population of 900. Until now, Mayville was served by a bookmobile from a larger town. The Mayville Village Council has authorized funds for a small public library,...
-
Explain how advanced computational methods, such as Monte Carlo simulation and Bayesian networks, can be applied to improve hazard analysis accuracy and reduce uncertainty in risk assessment .
-
Following is partial information for the income statement of Timber Company under three different inventory costing methods, assuming the use of a periodic inventory system: Required: 1. Compute cost...
-
Vernon Entertainment sells souvenir T-shirts at each rock.concert that it sponsors. The shirts cost $14 each. Any excess shirts can be returned to the manufacturer for a full refund of the purchase...
-
According to the quantity theory of money and the Fisher effect, if the central bank increases the rate of money growth, then a. inflation and the nominal interest rate both increase. b. inflation...
-
Eva bought a GMC Sierra 1500 pickup. To finance the purchase, she signed a note and an agreement to pay the note with Ranch & Farm Credit Union. After she had made half of the sixty payments on the...
-
What impact may cultural differences between partners have on global alliances?
-
The extra return that stocks earn over bonds (on average) compensates stockholders for a. the greater market risk that stockholding entails. b. the greater firm-specific risk that stockholding...
-
GDP is an imperfect measure of well-being because it a. includes physical goods produced but not intangible services. b. excludes goods and services provided by the government. c. ignores the...
-
Two shoemakers entered the competition, main goal of creating ten pairs of shoes, all sized precisely at 2 6 c m , equivalent of 4 0 1 / 2 . Only precision of the size will be evaluated. The...
-
To help you become familiar with the accounting standards, this case is designed to take you to the FASBs Web site and have you access various publications. Access the FASBs Web site at...
-
Identify the x- and y-intercepts of the graph. 1. y = (x - 3)2 2. y = 16 - 4x2 3. y = |x + 2| 4. y2 = 4 - x 5. y = 2 - 2x3 6. y = x3 - 4x y 10 6. 4 2 to -4 -2 2 4 6 8 y 20 8. 4 1 3
-
The revenue R (in millions of dollars) for a construction company from 2003 through 2010 can be modeled by R = 0.1104t4 - 4.152t3 + 88.20t2 - 654.8t + 1907, 7 t 16 where t represents the year, with...
-
(a) use a graphing utility to create a scatter plot of the data, (b) decide whether the data could best be modeled by a linear model, an exponential model, or a logarithmic model, (c) explain why you...
-
Verify that \(\left|\Delta v_{\mathrm{u} x} ight| /\left|\Delta v_{\mathrm{s} x} ight| \approx 1 / 3\) for the two carts in Figure 4.9. Figure 4.9 Velocity-versus-time graph for a standard cart and a...
-
Is the inertia of the cart of unknown inertia in Figure 4.9 greater or less than that of the standard cart? Figure 4.9 Velocity-versus-time graph for a standard cart and a cart of unknown inertia...
-
What is the ratio of the \(x\) components of the change in velocity for the plastic and metal carts, \(\Delta v_{\mathrm{p} x} / \Delta v_{\mathrm{m} x}\), in Figure 4.10? Figure 4.10...
Study smarter with the SolutionInn App