Skip to content
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.

dstarner/expression-evalutor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Evaluation Expression

This calculator can take in valid mathematical expressions in 'infix notation' and evaluate their end values, 'post-fix' and 'pre-fix' notations and pipe them to an output file of your choice.

It will follow valid precendence set forth by PEMDAS, so parentheses and '/' and '*' precendence will be true. The calculator can also take in valid Roman Numeral values, either in uppercase or lowercase. Invalid Roman Numerals will result in a failure.

To test and run this program, build it with make.

You can then run it by passing two parameters.

./main <input> <output>

# Example

./main input.txt output.txt

An example of the input file can be:

5 + (VII * iii) - 3

The output of the file will be such as below:

Prefix:  * -15 + 4 6
Postfix:  -15 4 6 + *
Value: -150

About

This is an expression evaluator written in C. This was a class project for a Software Quality and Debugging course.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published