Working on the improved calculator program
In this new program, we want to add the following features:
- Allow a user to repeatedly input numbers for calculations
- Make another version of the
Addfunction, which adds float values - Add some comments to explain what the code blocks do
- Put the
Addfunctions into the separate header and source files –Calculator.handCalculator.cpp
Follow these steps:
- Create a new project and name it
MyCPP_03. - Add the
main.cpp,calculator.cpp, andcalculator.hfiles to the project. Your Solution Explorer window should now have the files under theHeader FilesandSource Filesfolders, like so:
Figure 3.16 – The MyCPP_03 Solution Explorer
- Next, type the following code into the
main.cppfile:#include <iostream>
#include "Calculator.h"
using namespace std;
void main()
{cout << "My Calculations" << endl;
&...