Coding Programming

Completado Publicado Oct 4, 2015 Pagado a la entrega
Completado Pagado a la entrega

The project involves completing and extending the C++ program that evaluates statements of an expression language contained in the module 3 case study.

The statements of that expression language consist of an arithmetic expression followed by a list of assignments. Assignments are separated from the expression and each other by commas. A semicolon terminates the expression. The arithmetic expressions are fully parenthesized infix expressions containing integer literals and variables. The valid arithmetic operators are +, –, *, /. Tokens can be separated by any number of spaces. Variable names begin with an alphabetic character, followed by any number of alphanumeric characters. Variable names are case sensitive. This syntax is described by BNF and regular expressions in the case study.

The program reads in the arithmetic expression and encodes the expression as a binary tree. After the expression has been read in, the variable assignments are read in and the variables and their values of the variables are placed into the symbol table. Finally the expression is evaluated recursively.

Your first task is to complete the program provided by providing the three missing classes, Minus, Times and Divide.

Next, you should extend the program so that it supports relational, logical and conditional expression operators as defined by the following extension to the grammar:

<exp> -> '(' <operand> <op> <operand> ')' |

'(' <operand> ':' <operand> '?' <operand> ')' |

'(' <operand> '!' ')'

<op> -> '+' | '-' | '*' | '/' | '>' | '<' | '=' | '&' | '|'

Note that there are a few differences in the use of these operators compared to their customary use in the C family of languages. There differences are

In the conditional expression operator the symbols are reversed and the third operand represents the condition. The first operand is the value when true and the second the value when false

The logical operators use single symbols not double, for example the and operator is & not &&

The negation operator ! is a postfix operator, not a prefix one

There are only three relational operators not the usual six and the operator for equality is = not ==

Like C and C++, any arithmetic expression can be interpreted as a logical value, taking 0 as false and anything else as true

Your final task is to make the following two modifications to the program:

The program should accept input from a file, allowing for multiple expressions arranged one per line. Some hints for accomplishing this transformation will be provided in the conference

All results should be changed from double to int. In particular the evaluate function should return an int.

You may assume that all input to the program is syntactically correct.

You are to submit the source code for the entire program in a .zip file. Your program must compile with Microsoft Visual C++.

Programación en C++ Java

Nº del proyecto: #8612885

Sobre el proyecto

15 propuestas Proyecto remoto Activo Oct 5, 2015

Adjudicado a:

mahershahmeer

Hi there! I'm a Professional Software developer and Data Analyst for a well known Software House in Islamabad named PacSquare Pvt Ltd. If I get this job, I assure you that you'll get my best services in return. Plea Más

$40 USD en 3 días
(129 comentarios)
6.2

15 freelancers están ofertando un promedio de $128 por este trabajo

Yknox

Hello I'm interesting your project very well I'm a Good C++, Java, Compiler-Copiler, Math, Algorithm expert. I understand your req exactly. I m quite well experienced in these jobs. Let's go ahead with me I w Más

$210 USD en 2 días
(859 comentarios)
9.1
dobreiiita

Hello I am C++ and Algorithm expert and interested in this project. I have gone through the details and confident to handle this project. I also have a lot of experience in helping students with assignments. Ple Más

$150 USD en 3 días
(519 comentarios)
7.6
mitkoradev

Hi, this seems like a nice project. I think it won't take more than few hours at most, maybe even less if I haven't misunderstood some details. I propose to do the job and send an executable for tests, after some ne Más

$55 USD en 3 días
(156 comentarios)
6.7
ahmsak

Hello Sir... I am a computer science teacher, I teach (among others) Compilers and Algorithms. I have done many projects like this. Please contact me for more details when possible. I look forward to work for you S Más

$160 USD en 3 días
(71 comentarios)
6.0
rinabuoy13

A proposal has not yet been provided

$55 USD en 3 días
(39 comentarios)
5.7
mehmood168

Hello, I am a Java developer with strong expertise and vast experience. I have understood the requirements. I am ready to work for you. Will give you the best results, on-time delivery. Thanks

$56 USD en 2 días
(49 comentarios)
5.5
maxkoryukov

Hello! May I solve this task for you? Do you already have a solution for task for module 3. . Más

$200 USD en 3 días
(16 comentarios)
4.9
KarimRagab

I am an embedded software engineer with years of experience in Java and C/C++ programming, doing my master's degree with 'A' total subject's grade in artificial intelligence and machine learning. I will do my best t Más

$55 USD en 3 días
(14 comentarios)
3.5
Egran

i usually work under TDD, so i would send you unit tests

$200 USD en 5 días
(5 comentarios)
3.0
saunv2012

A proposal has not yet been provided

$166 USD en 3 días
(0 comentarios)
0.0
upalavivek

A proposal has not yet been provided

$77 USD en 15 días
(0 comentarios)
0.0
aravakrishna

A proposal has not yet been provided

$200 USD en 7 días
(0 comentarios)
0.0