Java calculator

Posted on 2009-02-18
Last Modified: 2013-12-29
hi I was wondering if somebody could givew me a few pointers as to how a i could implements a calculator in java
I have to be able to take in some data in file format
a b
1 2
3 2
1 6
and processes it by the application of functions as chosen by the user from a button panel.
Question by:greenhal
    LVL 86

    Accepted Solution

    First you need to read the file and parse out the operands


    and String.split

    Author Comment

    Thanks could you help me with this though its
    just i need a way to do this
    so for example the user chooses the following (1) ( sin a)  ( cos a) and then this is applied so that
    b = B1(1) + B2(sin a) + B3(cos a) where i have to solve for B1 B2 B3 so its a system of matrix equataions could you help me with logic of how to do this?
    LVL 86

    Assisted Solution

    Sounds like you might need  something more elaborate. Check out the Jep expression parser e.g
    LVL 4

    Expert Comment

    Elaborate more, what are B!,B2 & B3.
    Can you post whole problem statment

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Prime numbers are natural numbers greater than 1 that have only two divisors (the number itself and 1). By “divisible” we mean dividend % divisor = 0 (% indicates MODULAR. It gives the reminder of a division operation). We’ll follow multiple approac…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This video teaches viewers about errors in exception handling.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now