import logo from './logo.svg'; import {useEffect,useState} from 'react'; import './App.css'; function Equation(p) { const {data,id,equationParts,setEquationParts,field,operator} = p function updateEquation(field,operator) { var eq = [...equationParts] eq[id].field=field eq[id].operator=operator setEquationParts(eq) } return <>

{data[field]}
{operator!=="disabled"&&

} } function EquationBuilder(p) { const {data} = p const [equationParts,setEquationParts] = useState([]) const [equation,setEquation] = useState([]) function SolveEquation(eq) { var newEq = [...eq] //Multiplication and Division first. for (var i=0;i{ var newEq = [] for (var i=0;i

{equationParts.map((eq,i)=>)}

{equation.slice(0,-1)}

{SolveEquation(equation)}

} function App() { const fieldData = { data1:84, data2:49, data3:3.5, data4:67 } return (
); } export default App;