Question: Hello, I'm doing the CMSC 330 Project 2 assignment. I have most of it finished but need assistance with the final part. I'm able to

"Hello, I'm doing the CMSC 330 Project 2 assignment. I have most of it finished but need assistance with the final part. I'm able to get the results to show on my console but I don't know how to pass the results to the rest of the program. I can get the variable "line" to the console. How do I pass it to the rest of the program? Thank you See below my main().

#include

#include

#include

using namespace std;

#include "expression.h"

#include "subexpression.h"

#include "symboltable.h"

#include "parse.h"

SymbolTable symbolTable;

void parseAssignments();

int main(){

Expression* expression;

char paren;

char comma;

string line;

ifstream inputFile("text.txt");

if (inputFile.is_open()) {

while (getline(inputFile, line)) {

cout << line << ' ';

}

inputFile.close();

}

else

cout << "File is not open" << ' ';

expression = SubExpression::parse();

cin >> comma;

parseAssignments();

cout << "Value = " << expression->evaluate() << endl;

cin.get();

return 0;

}

void parseAssignments(){

char assignop, delimiter;

string variable;

double value;

do{

variable = parseName();

cin >> ws >> assignop >> value >> delimiter;

symbolTable.insert(variable, value);

} while (delimiter == ',');

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!