Algorithm for Calculator application

Click For Summary

Discussion Overview

The discussion revolves around developing an algorithm for a calculator application, specifically focusing on the implementation of a graphical user interface (GUI). Participants explore different approaches to building the calculator, including parsing expressions and utilizing existing libraries.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant requests a complete algorithm for a GUI calculator application, expressing dissatisfaction with existing resources that only cover basic operations.
  • Another participant suggests that the project goal should be clarified and proposes using a library or language feature like 'eval' to evaluate mathematical expressions, indicating that this could simplify the implementation.
  • A different participant mentions their intention to develop a simple GUI calculator in MATLAB, focusing on basic arithmetic operations.
  • One participant, unfamiliar with MATLAB, speculates that the algorithm may not be necessary and recommends using MATLAB's GUI library to construct strings for the 'eval' function instead.

Areas of Agreement / Disagreement

There is no clear consensus among participants regarding the necessity of developing a complete algorithm versus utilizing existing features or libraries. Multiple approaches are suggested, indicating a lack of agreement on the best method to proceed.

Contextual Notes

Some assumptions about the capabilities of the programming environment (e.g., MATLAB) and the specific requirements of the calculator application remain unaddressed. The discussion does not resolve the best approach to parsing expressions or the overall algorithm design.

Aaron Angel
Messages
5
Reaction score
0
I need an algorithm for developing a calculator application. When I googled , I got results that perform the ordinary push and pop operations . I need the complete algorithm that can be useful to code a calculator application in GUI.
 
Computer science news on Phys.org
What is the goal of your project?

You could just download a library that evaluates mathematical expressions (or use a language feature like 'eval') and then have your GUI build strings to feed it.

If you want to know how expressions are parsed you might want to look into lex and yacc
http://en.wikipedia.org/wiki/Lex_(software)
 
I am trying to develop a simple GUI calculator in matlab. I am going to perform simple operations like +-*/ . that's it.
 
I don't know MATLAB very well, but I'm guessing you don't need to worry about the algorithm, just use their GUI library to build strings and then feed those strings into matlab's eval function.
 

Similar threads

Replies
45
Views
7K
Replies
5
Views
925
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
3
Views
12K
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
4
Views
3K
  • · Replies 22 ·
Replies
22
Views
3K