We end every month summing up the all the things that happened in InterWorks. In other words we count the successes, the failures, the funny moments, the sad moments, new things that started, old that ended…. All of these things are summed up and put into our monthly Newsletter. Ok not only that, we also have one extra section covering a Brain Teaser which our employees solve each month.
This month we decided to share our Brain Teaser with all of you and give you an exclusive chance to win a SPA weekend for two in Ohrid.
Following is the task:
After that create a program that will read that file and provide results from the mathematical expressions contained within.
The solution code should be generic and capable to process files having the same structure!
Do not use existing libraries or functions for mathematical expression evaluation. Code the logic behind it :)!
The program shall print the evaluation results on the console in the following format:
Solution Hint: Don’t forget that “InterWorks” will always give you the Exclusive capabilities to Unmask your goals!
Send us the value of the Accumulator along with the solution code.
The first one to send us the correct answer on firstname.lastname@example.org, will be considered a winner. He/she will be invited at InterWorks to present their solution.
In attachment you can find the solution of the brain teaser. The purpose of the brain teasers is to enrich the knowledge, and the intention of this Brain Teaser was to:
- Learn how to encrypt/decrypt with logical binary XOR operation that is the only reversible binary operation
- Learn what is Infix notation and why it is hard to evaluate these expressions
- Learn what is Postfix notation and why it is easy to evaluate these expressions
- Learn what is Shunting-yard algorithm that converts from Infix into Postfix notation
Thank you to all who sent us answers, unfortunately none were correct…
Until next time 🙂