Calculator using variable names

I’ve recently been assigned an assignment to create a word calculator, and given my knowledge in python is still quite lacking, I want to ask if anybody has any better ideas for any possible solutions. The question is here: Jimmy has invented a new kind of calculator that works with words rather than numbers. Input … Read more

Replace a^b by Pow(a,b)

The application uses NCalc to execute diverse calculations. The ‘natural’ way to write powers using a computer is using the ^ symbol. However, NCalc already uses it as bitwise or. I use the following function to parse calculations and convert it to the Pow(a,b) format. Private Function _replacePower(Str As String) As String Const PowerString As … Read more

Boolean expressions from infix to postfix notation using Dijkstra’s Shunting Yard algorithm

I began working on a Java library that receives a boolean expression such as not A and (B or not C), compiles it to a circuit of logical gates C, minimizes C, and converts back to a (possibly shorter) boolean expression. Now, first things first: I need to be able to tokenize each input expression … Read more

Math app/library that solves calculus problems (symbolic derivative, etc)

Let me start off by saying that this project is a mess, and I know it. I believe it is a mess because I threw it together in a few days just to get it working. Unfortunately, my undergraduate education hasn’t taught me design patterns (yet), so there is really no organized structure. If I … Read more

Solve simple derivative questions

Built my first script and its function is to solve simple derivative questions. How can I improve this code? This is my first time posting. #This is Simple Derivative Solver def derivative(): print(“This program will give you the first derivative.”) input(“Press ENTER to continue…”) cf=int(input(“Enter the coefficient of the term…”)) exp=int(input(“Enter the exponent of the … Read more

Algorithm to compute the n-th derivative of a polynomial in Python

As a personal exercise, I’m trying to write an algorithm to compute the n-th derivative of an ordered, simplified polynomial (i.e., all like terms have been combined). The polynomial is passed as an ordered list where the i-th index corresponds (though is not equivalent) to the coefficient of x to the n-th power. Example: Take … Read more