|
General Details
|
|
C++
|
|
Posted 74 Days Ago
|
|
255 Views
|
|
Received 1 Rating
|
|
Simple C++ Calculator
Description
A calculator for elementary students.
Four basic mathematical functions:
1. Addition - No negative numbers allowed, only positive numbers.
2. Subtraction - No negative numbers, only positive, only positive outcomes.
3. Multiplication - No negative numbers, only positive outcomes
4. Division - No divide by zero, no negative numbers, no negative outcomes, no remainders
Technical
Dev-C++, Visual Studio/Visual C++ Express
Source Code
Comments
| Please login to post comments. |
|
|
Thanks.
I was thinking about making a class for this calculator and use some void functions to make the calculations. That'll be the next upgrade. I think that I will use switch, like you suggested, instead of a bunch of if statements, to call the different functions that are created. The next version will probably be 1.50 (if I've calculated all the upgrades right).
Needless to say, I haven't made many C++ classes, so I'm going to get out my ol' C++ book and practice a few classes before I try to make the class for this calculator.
|
|
|
Good code. :) It's good to see someone writing C++ instead of some C-C++ hybrid.
If you want to make the code more readable, I would replace the if statements with a switch statement. I would also group code into methods and then just call them from the switch statements.
|
More "C++" Source Codes By This Author
Recently Posted "C++" Source Codes
Recently Rated "C++" Source Codes
|