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
Try not to useusing 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.
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.
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.
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 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.
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.
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.
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.