/********************************************** * Name: Greg Holle * * Date: 4/17/06 * * Assignment: Project 8: * *********************************************** * ***********************************************/ #include #include #include //#include "number.h" using namespace std; int main() { char buffer[50]; char *token; string input[2]; string inputformat[2]; string operation="NULL"; string format="Integer"; int count = 0; cout << "Enter an arithmetic expression: "; cin.getline(buffer, 49); for(int x=0; x<50; x++){ if (buffer[x]=='+'){ operation="+"; } else if (buffer[x]=='-'){ operation="-"; } else if (buffer[x]=='*'){ operation="*"; } if (buffer[x]=='/'){ if (format=="decimal"){ //do nothing } else{ format="fraction"; } } else if (buffer[x]=='.'){ format="decimal"; } } token = strtok(buffer, " +-*"); while(token != NULL) { input[count]= token; count++; if (count==3){ cout<<"Incorrect formatting. Program ending.\nPress any key to continue."<