michaelrlee / cli-calculator Goto Github PK
View Code? Open in Web Editor NEWCAS 2S03 HWK6
CAS 2S03 HWK6
I believe that once we build the tree, we should recurse down all the way to evaluate the expression. The recursion will stop when we reach a Number, because a Number can't be broken down any further.
I may think of more later
Test Shilip's code.
Ensure that a sequence like this:
"12345 32423"
causes the validator to return 0.
We need to implement this method so that we can convert the string expression returned by each ArithmeticExpression's evaluate() to a floating-point number. We also need to implement this in each subclass of ArithmeticExpression.
This algorithm assumes that the expression has already been validated.
$n - The index in the string at which we start searching for unnecessary brackets
$l - The current "level" in the expression we are at - i.e., the # of left/right brackets seen so far.
$nPos - The position at which the number token starts in the string
$rBPos - The position at which the first right bracket is encountered.
$i - Current index in string (used while looping through the string)
Given a position $n which is the index of a starting left bracket:
Implement the bonus, as described in the PDF.
The parser needs to be converted to use the project's classes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.