TASK #1 - Calculator You are given a string, $s, containing mathematical expression. Write a script to print the result of the mathematical expression. To keep it simple, please only accept + - * (). Example 1: Input: $s = "10 + 20 - 5" Output: 25 Example 2: Input: $s = "(10 + 20 - 5) * 2" Output: 50 MY NOTES: Ok, so a mini parser of a string in one or more command line arguments. What's the easiest way? - use Parse::RecDescent? - hand write a recursive descent parser? - convert to RPN and evaluate RPN? TASK #2 - Stealthy Number You are given a positive number, $n. Write a script to find out if the given number is Stealthy Number. A positive integer N is stealthy, if there exist positive integers a, b, c, d such that a * b = c * d = N and a + b = c + d + 1. Example 1 Input: $n = 36 Output: 1 Since 36 = 4 (a) * 9 (b) = 6 (c) * 6 (d) and 4 (a) + 9 (b) = 6 (c) + 6 (d) + 1. Example 2 Input: $n = 12 Output: 1 Since 2 * 6 = 3 * 4 and 2 + 6 = 3 + 4 + 1 Example 3 Input: $n = 6 Output: 0 Since 2 * 3 = 1 * 6 but 2 + 3 != 1 + 6 + 1 MY NOTES: hmm.. need some kind of brute force search, presumably. what are the limits of a..d? first thought: each <= $n, hang on, (a,b) must be a factor pair of n (where a is a factor of n <= sqrt(n) and b is n/a), and (c,d) must also be a factor pair of n. As a bonus, I've also implemented the --firstn flag which makes it find and display the first $n stealthy numbers.