unsigned int counter[256]{}; //overkill, this can count any ascii input without a lot of thinking about it.
..blah blah
cin >> Area;
counter[Area]++;
... blah blah switch and such
...
cout << "A was executed " << counter['A']; //etc format text as you see fit.
Interesting little program for beginners.
Maybe I misunderstood your question, but why don't you use some simple incrementations with integers? In each case section, you can ++ them, displaying them at the end of the process. This is so easy. For this reason, I guess that I misunderstood something. Let me know...
@Geckoo - that is how I understood the question, just some simple integer increments as per my code above. Jonnin idea's more general (and better IMO) but I didn't know if they had covered arrays....
Its really the same idea, just a more compact implementation by putting the counters in an array and lazily associating them to the possible inputs thx to the beauty of ascii (its a wonderful code, long as you speak english!).
at the end of the day you still have 5 or whatever counters active getting bumped based off the input.
Your formula to calculate the area of a circle is wrong when using the radius. You are using the formula when the diameter is known.
A circle's diameter is double the radius.
The correct formula when the radius is known is shown by seeplus.
And IMO using the C library pow function to calculate the area of a square is a bit of performance overkill. Not wrong, just rather hackish, since an int is promoted to a double by casting.