Skip to main content
Code Review

Return to Revisions

2 of 3
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/

Unless you'll be maintaining an accumulated number for multiple operations, this may not be the best use of classes. For your code, you'd get the same effect by just performing these calculations within the switch statement (something similar to this). Right now, you're just using a class to contain similar functions, including a trivial output function.

Some additional notes:

  • Try not to use using namespace std.
  • Indent everything within main() as well. Not doing so may make it hard to tell that the code is being contained within something.
  • You don't need <conio.h> here, so just remove it.
  • It may be useful to prevent the user from dividing by 0, which is undefined behavior.
Jamal
  • 35.2k
  • 13
  • 134
  • 238
default

AltStyle によって変換されたページ (->オリジナル) /