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...
-
Assume that B (in Problem 1) is $3 million and S is $7 million. The bonds have a 14 percent yield to maturity, and the stock is expected to pay $500,000 in dividends this year. The growth rate of...
-
Each of the following reactions has been reported in the chemical literature and gives a predominance of a single product in synthetically acceptable yield. Write the structure of the product. Only...
-
The combined law of thermodynamics is represented by (a) \(d U=T d S-P d V\) (b) \(d U=T d S+P d V\) (c) \(d U=d Q+P d V\) (d) None of these.
-
Preparing a schedule of cash payments for selling and administrative expenses The budget director for Metro Cleaning Services prepared the following list of expected selling and administrative...
-
According to the graph below, at what point will reducing your amount of diversifiable risk in a portfolio become very difficult? 49.2% Risk (Portfolio Standard Deviation) 19.2% # of securities in...
-
1. What portion of her eligible home expenses may Camille claim as tax-deductible expenses if the expenses are allocated on the basis of (a) area? 2. What is her net business income if Camille...
-
ANDY NEED 14,000 FOR HIS SENIOR YEAR COLLEGE TUITION BILL. HE IS INTHE 30% TAX BRACKET. HOW MUCH SHOULD WITHDRAW FROM HIS IRA TO PAY TAXES AND STILL HAVE 14,000 FOR THE TUITION BILL 4200 14000 18000...
-
The following selected ledger accounts of Cameron Company are for February (the second month of its accounting year): Materials Inventory Feb. 1 balance February debits February debits Feb. 1 balance...
-
GameShock Corp. (GSC), an upstart Canadian technology firm, is contemplating the purchase of electronic communications equipment ( Hint : Check Canada Revenue Agency website to find which CCA class...
-
Herman and Sons' Law Offices opened on January 1, 2022. Herman's adjusted trial balance at December 31, 2022 is as follows: (Click the icon to view the adjusted trial balance.) Requirements Perform...
-
Two meters of compacted fill (y = 20 kN/m) is placed over a large area (Figure 4). A rectangular foundation of size 4 m x 5 m is constructed at the site with its base located at the existing ground...
-
1. Examine the long-term borrowings in AFs balance sheet and the related note (32.2.2). Note that AF has convertible bonds outstanding that it issued in 2013. Prepare the journal entry AF would use...
-
How would i put this into my financial calculator Assuming a discount rate of 6%, what is the present value of 100,000 per year for 12 years if the payments occur at the beginning of each period?...
-
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...
-
Determine the amplitudes of motion of the three masses in Fig. 6.40 when a harmonic force \(F(t)=F_{0} \sin \omega t\) is applied to the lower left mass with \(m=1 \mathrm{~kg}, k=1000 \mathrm{~N} /...
-
(a) Determine the natural frequencies and mode shapes of the torsional system shown in Fig. 6.11 for \(k_{t 1}=k_{t 2}=k_{t 3}=k_{t}\) and \(J_{1}=J_{2}=J_{3}=J_{0}\). (b) If a torque \(M_{t 3}(t)=\)...
-
Using the results of Problems 6.24 and 6.56, determine the modal matrix \([X]\) of the system shown in Fig. 6.29 and derive the uncoupled equations of motion. Data From Problem 6.24:- Find the...
Study smarter with the SolutionInn App