PROBLEM: How Are You Doing?

Statement

"How's it going?" The question may be a greeting, or it may actually be a query that requires assessing one's day. You woke up--that's "good". You had coffee--that was "good", too. Breakfast: "good". You spilled coffee on yourself, though, which was "bad". Then you realized you have a meeting with someone later on that you don't like, also "bad".

Write a program that takes a series of inputs from the user, the values "good" and "bad". When the user enters "done", the program will indicate whether the person's day is "good" or "bad", depending on which value was entered more often. Inputs that aren't "good", "bad", or "done" should be responded to with a message indicating that the input wasn't understood.

Prerequisite Skills

Sample Input/Output

"good","bad","good","good" --> "good"
"good","bad","bad" --> "bad"
"good","bad" --> "good and bad"

Metacognition

Have a student ask the instructor how the day is going, how she's doing, etc. The instructor responds by listing an inventory of how things have gone today so far:

"Well, I woke up, so that was good." (Count that event on a "good" hand.) "And then I got coffee, and that was good." (Count the event on a "bad" hand.) But then I stubbed my toe getting dressed, so that was bad. And I realized I'm out of deodorant, so that's bad. But then I got to school and came to this class, so that was good."

So, overall, it's been a"... (look at the two counters)... "'good' day."

Solution

Author

Richard White, rwhite@crashwhite.com

References

Inspired by the "positive, negative" problem mentioned at James Prather's ACM SIGCSE 2019 talk First Things First: Providing Metacognitive Scaffolding for Interpreting Problem Prompts