Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

ISBN: 3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

List the components of a business model of a business problem.

Answered: 1 week ago