Question: Python Programmin g: Q1.Move Terms Function I am now writing a mini calculator for solving equations. How can I write a python program to move

Python Programming:

Q1.Move Terms Function

I am now writing a mini calculator for solving equations. How can I write a python program to move terms in order to solve complicated equations? I can now input any combination of ax, b on both hand side, where a ,b are constants with a doesn't equals to 0 .

Example Input : Original Equation x+3=5

x + 3=5

Example Output :

x = 2.0

Q2.Expand Brackets Function

How can I write a python program for your calculator to break brackets and perform rainbow method? For simplicity, only one layer of bracket is accepted. I.e. c(ax + b) = d, where a, b, c, d are constant with a doesn't equals to 0 and c doesn't equals to 0

Example Input : Original Equation 4(2 5 ) 3 5 + = x

4(2-5x)+3 = 5

Example Output :

8.0-20.0x+3=5

-20.0x+11.0=5.0

x=0.3

Q3.Remove Denominator Function

The calculator is now extended to the removing denominator function. For an equation with at most one layer bracket, the program should be able to remove the denominator and solve the equation. Please be noted that in the program, an equation ax+b/c=d should be presented as "(ax+b)/c = d", where a, b, c, d are constant with a and c non-zero.

Example Input : Original Equation 5-(x+3)/4=3

5-(x+3)/4 = 3

Example Output :

20.0 - (x+3)=12.0

20.0-1.0x-3.0=12.0

-1.0x+17.0=12.0

x=5.0

Thank you very much!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!