i have to enter a string with the mathematical function \"2/3+3/8*3/9\" I need t
ID: 3553219 • Letter: I
Question
i have to enter a string with the mathematical function "2/3+3/8*3/9"
I need to make a split using the "/" character, so that iI can take the numerator and denominators into new strings(or a better solution that you tcan think off, take also the operators. calculate the comon divider, do the multiplication first then the sum.
is there any function like atoi in C++ that allows me to change a string location to Int.
here is the problem
Design and build a rational number calculator program. This calculator should read the mathematical
expression as an user input and add (+), subtract (-), multiply (*) or divide (/) the rational numbers. The
program should do the calculation using c# operator precedence rule; * and / are perform before + and -. It
also search for the maximum common divider to simplify the result.
The following is a sample run of the program
Input the mathematical expression: 1/3 * 2/4 + 5/9
Output: 1/3 * 2/4 + 5/9 = 78/108 = 13/18