Build a Complex JavaScript Calculator

  • Context: Java 
  • Thread starter Thread starter koolraj09
  • Start date Start date
  • Tags Tags
    Calculator Javascript
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 6K views
koolraj09
Messages
166
Reaction score
5
Hi guys.
I am mechanical engineering undergraduate and we have a website. Now we want to put up an interactive calculator on our website.
So we are trying JavaScript. Though we tried writing a code for our calculator it didn't work. At this time we're getting confused because of level of involvement of the code.
So can anyone point out to resources or examples (definitely not the easy arithmetic one's) for building up a calculator. For example if we want to calculate power loss in a circuit the input the user would give(in the form of FORM or submit command) is current I and resistance R. So we'd calculate the power loss for them.
We want input from users, where user will type his specifications(whatever they might be) and calculate the required things for him. Here are many examples of what type of calculator we'd like to build.
http://www.engineersedge.com/calculators/section_square_case_9.htm"
Any help would be greatly appreciated.
Thanks.
 
Last edited by a moderator:
Physics news on Phys.org
"Data Structures & Problem Solving Using Java" in chapter 11 shows how to take apart strings of characters and turn them into a calculation with precedence, parentheses, etc.

The source for that is available on the web at http://users.cis.fiu.edu/~weiss/dsj2/code/code.html but I think that might be rough sledding for an ME without the textbook to back it up. There are old editions of the book available at bargain prices http://www.bestwebbuys.com/Data-Str...g-Using-Java-ISBN-9780201549911?isrc=b-search I would certainly grab a copy of that if I were trying to use that source.
 
Last edited by a moderator: