I’ve already completed C++ I at my community college. I left the class with an A. Going in to C++ II, I was feeling pretty good. I finished my first quiz for this next course and turned it in and…. what a way to start – with a big fat 0. My program crashed on my professor.
He’s the same professor I took for C++ I. I really like the way he teaches – which is why I signed up with him for this next course – but, he’s very adamant about turning in projects that DO NOT CRASH and he definitely tries to crash them. It’s good, though. I’d hate to be at a job turning in work that crashes.
Not that he had to do much to crash it. For the quiz, we had to take a user’s numeric input and display the even digits. I thought I had tested every scenario: What if the user inputs alphabet? What if the user inputs white space? What if the user inputs special characters? What if there are no even digits to display?
But, I did not: What if the user doesn’t put in anything? My program crashes.
I’d like to go back and fix it, however, quiz 2 is already underway. I will be testing for no input whatsoever π
Quiz 1 – Display even digits. If none, state that no even digits to display. The professor included a “starter file” that we were to build off of.
https://github.com/Velourious/quiz_1/tree/master
(Click on “main.cpp” to see the program)