Tuesday, February 21, 2012

Challenge 2/21/2012

Part 1

- 10 equations that do not pass but should for your calculator
- why does each test case fail? What should be considered?

Interpretation of first question: Submit equations that don't work on my calculator but should.

My calculator has issues with ',' and unary operators at present, but assuming that those were working correctly, equations with the following characteristics would not correctly evaluate:

+equations that use numbers with floating point precision (1.2 + 3.4)
           ex. it would split 1.2 into 1, . , and 2
+equations with multiple unary operators (---)
           --9+ ---3
+equations with operations that are more than one character
           ++. --. etc
+equations lacking correctly paired ()s
           maybe "shouldn't" work anyway, but it would be nice to deal with that somehow... perhaps infer where one should go?
+ not sure if functions within functions would work on mine
  sin(cos(sin(...cos(3.14+.... etc.))))
+ operators that take more than 2 inputs don't work yet
  old version (not rewrite) had only left and right nodes. Would require 3 prong node, but maybe a vector of pointers could be used to later add number of children with ease

Part II is inaccessible to me at this time...

Other equations that won't work on MyCalc -
(simply because I'm still not there yet)
use of user-added functions

I expect issues with the following:
user functions that contain the names of actual functions within them (ex: sinuserdef() )



Assignment for Thursday:


//Equations to use for testing : 
//GRACEFUL FAIL?
10 (+) 8 (*) 2 (+) 8
10 ()+ 8 * 2 + 8
(10 + 8 * 2 + 8
10) + 8 * 2 + 8

//FAILING FUNCTIONS
sin(45,8) 
sin(45,,)
sin45
(sin)45 

//PARENS ANYWHERE?
(10 + 8) * 2 + 8
(10) + (8) * (2) + (8)
(((10 + 8) * 2) + 8)

//UNARY OPERATORS
-(10) + 8 * 2 + 8
--10 +  8 * 2 + 8
---10 + 8*2+8
-(-(-(10))) + 8*2+8

No comments:

Post a Comment