Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please edit MY code, to implement the ^ to be able to calculate squares. My code right now can only add and subtract, and is
Please edit MY code, to implement the "^" to be able to calculate squares. My code right now can only add and subtract, and is able to identify ";" as the end of a formula and it reads through the redirected file to see if there is more, and prints the sum of each seperate formula. Please see the example in the task description, and use the hint if possible.
Write an even better calculator program calc3.cpp that can understand squared numbers. We are going to use a simplified notation X^ to mean X?. For example, 10^ + 7 - 51" should mean 102 + 7 - 512 Example: When reading input file formulas.txt 5; 1000 + 6" - 5+ 1; the program should report: $ ./calc3 using namespace std; int main() { int s, sum=0; cin>>sum; char op; while(cin>>op>>s) { if(op == ';'){ cout Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started