You can however use a form to choose a train of operators and numbers, but that's just a fudge IMO.
This site features a snippet (if not the whole thing) in making a calculator using php: Click Here
Asking for js help here is likely to get you half-cocked ideas from back-end developers :) No offence to the cross-over gurus that frequent this forum.
(agreeing with diafol)
I hope you noticed that nobody will give you/write the code for you, we can only help you with what you have... that's the idea of learning with teachers... they can't do the work but can point out/guide you in getting something done.