MastaC729

CMPSC 122 Homework 3 driver.cpp

Feb 21st, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include "evaluate.h"
  4. int main()
  5. {
  6.     char userInput[80];
  7.  
  8.     cout << atoi("1+E5") << endl;
  9.     cout << "Evaluation of 22 + 3 * 4:" << endl;
  10.     evaluate("22+3*4");         // Output of evaluation is included in evaluate
  11.     cout << "(2+3) * 4 = " << evaluate("  (2+3) * 4") << endl;
  12.  
  13.     cout << endl << "Try one yourself:  ";
  14.     cin.getline(userInput,80);
  15.     cout << userInput << " = " << evaluate(userInput) << endl;
  16.     cout << endl << "Try another:  ";
  17.     cin.getline(userInput,80);
  18.     cout << userInput << " = " << evaluate(userInput) << endl;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment