Skip to content

It is difficult to create an algorithm that will solve mathematical equations correctly and be fast enough. Polish notation is good at this.

Notifications You must be signed in to change notification settings

AlexFaktor/ReversePolishNotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This project was the fourth assignment I completed in the course. By doing this assignment, I got to know the Polish notation that solves equations efficiently, became well aware of the importance of algorithms, and also implemented the work of reading from an equation file and writing the results to another. There are also unit tests.

Task

Implement two modes for application "Calculator":

1) Users work in a console application with simple operations. Operations should be executed with math priority (* / + -)

Examples:

Input -> Output
"2+2*3" -> "8"
"2/0" -> Exception. Divide by zero.

2) Work with files. Application read data from file line by line. Implement calculation with brackets. Each line shoud be calculated abd the result written to a different file.

Example:

Input file
1+2*3(3+2)
1+x+4
2+15/3+4*2

Output file
1+2*3(3+2) = 11
1+x+4 = Exception. Wrong input.
2+15/3+4*2 = 2+15/3+4*2 = 15

Features:

  • Two modes of operation

    • Console
    • From file to file
  • Support for degree, parenthesis, and basic mathematical operations

  • Error handling

Contacts:

About

It is difficult to create an algorithm that will solve mathematical equations correctly and be fast enough. Polish notation is good at this.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages