calculator

Simple Program Question (TI-84 calculator)

I wrote a program (on my TI-84 calculator) to satisfy the following exercise: Write a program that will print all solutions of the inequality ax + b < c, where a, b, and c are entered by the user. In this program the domain of x will be a set of consecutive integers, where the smallest and largest members of the set will also be entered...

Finding the default calculator (cross-platform)

How would I find and run the default calculator in java without making my program platform dependent. I could just hard-code all the paths for each major OS, and then find the OS the person is using and then use that OS's respective path. But, see I don't want to do it like that, is there anyway to do it without hard-coding the paths in?...

Need a calc example for ANTLR3

Hi/lo. I've succesfully installed ANTLR3 on my Windows and bound it to Visual Studio, but... Could anybody show me a working example of calculator in C++/ANTLR? The same as from distrib, which is written in Java. I have a trouble making it. I use std::map<std::string, double> for nametable, but one cannot load C++ headers from @header,...

why is this sin method returning a wrong answer?

Hey, working on some categories and I've bumped up against a weird issue, im basically expanding on a calculator class to add some trig methods, and i am getting an incorrect value when i call the sin method in the return in the form of a double. i send a value of 100.7 to the method and it returns 0.168231, from what i can see the corre...

Calculator stack

My understanding of calculators is that they are stack-based. When you use most calculators, if you type 1 + 2 [enter] [enter] you get 5. 1 is pushed on the stack, + is the operator, then 2 is pushed on the stack. The 1st [enter] should pop 1 and 2 off the stack, add them to get 3 then push 3 back on the stack. The 2nd [enter] shouldn't ...

Real Programmer's Calculator

Hi I know there are plenty of good software "programmer's" calculator, but I often find myself in places where access to my favorite soft calculator is not possible. Where can I find real (ie: hardware) programmer's calculators? I already did a google but the vast majority of results are of software or calculators that are no longer be...

where's the code for Calculator showcase?

Hi, Where can I see the code for the calculator? I mean the one with fancy background? By the way, it looks very nice!! In general, I could not find enough material for custom-made decoration, by searching the documents. Please let me know where I can learn deeper about rendering and widget decoration. Thanks in advance :) ...

How do I detect an operator vs. int in C using scanf?

How do I read in the following input in my RPN calculator so that it will find the operator no matter what order? 2 2+ 4 As of now my scanf only sees the first char in the string and I can only do this: 2 2 + 4 I'm also trying to add an option for integer vs floating point mode. (ex. when 'i' is entered, operate in floating point a...

Fewer connections in a Qt calculator

I'm writing a simplified calculator using Qt with C++, for learning purposes. Each number is a QPushButton that uses the same slot to modify the text in a lineEdit widget being used as a display. The slot uses the sender() method to figure out which button was pressed, so the correct number would be written on the display widget. In or...

What is the easiest way to add a float mode to this C Calculator?

What is the most efficient way to create a floating point mode where the user can enter 'f' or 'i' to switch between integer and floating point? I'd like to do this without having to copy the entire code for floats. I know typecasting is an option but I'm not completely sure if it's the safest way. #include <stdio.h> #include <stdlib.h>...

PHP Calculator Problem

Hi, I'm trying to create a calculator where the user can put in 4 values, these then each multiply by 0.75 and then get added together to give a price in pounds. -----------My HTML:---------- <h2>Monthly Fee &amp; transactions Calculator </h2> <form action="orderprocessing.php" method=post> <table> <tr><td>Total of invoices you send ...

Creating a GUI Calculator in python similar to MS Calculator

I need to write a code that runs similar to normal calculators in such a way that it displays the first number I type in, when i press the operand, the entry widget still displays the first number, but when i press the numbers for my second number, the first one gets replaced. I'm not to the point in writing the whole code yet, but I'm s...

Decimal point in calculator c#

AHHHHH ok this is driving me nuts. Why when does my decimal point in the wrong place e.g. if i have the string 567 in the textbox and click the decimal button i would expect (or i want) the textbox to change to 567. but instead i get .567 It only goes into the correct place when i add another number e.g. if i had the number 4 then st...

What's the easiest language/api/webapp to build a public calculator for simple 4-5 equation functions?

Most of what I need to accomplish is doable with Google docs spreadsheets, except locking only certain fields to allow updates by the public so they can do their own calculations based on the data. I would like the lowest method entry cost of writing simple table data with some functions that allow user update/selection. Free form portab...

FLEX/BISON : Why my rule is not regonized ?

Hi, I am trying to do a little exercice in FLEX and BISON. Here is the code I wrote : calc_pol.y %{ #define YYSTYPE double #include "calc_pol.tab.h" #include <math.h> #include <stdlib.h> %} %start line %token NOMBRE %token FIN %% line: exp '\n' { printf("\t%.2lf\n", $1); }; exp: exp exp '+' { $$ = $1 + $2 ;} | exp exp '-' { $$ =...

Polynomial Calculator

Hello all, I'm doing a polynomial calculator and i'll need some help as i'll progress with the code. For now I made only the polinom class which i represented it as a linked list with terms and some functions(only read and print the polynomial functions for now). Here's the main program which for now only read a polynomial and prints i...

StackOverFlowError in Java postfix calculator

---sorry i dont want my code to be here anymore until the deadline is over--- ...

Online option calculator like Sitmo.com

I'd like to know the best way to create online calculator for stock options such as this site http://www.sitmo.com/live/OptionVanilla.html I can see it uses CGI, and I like to learn what other ways to achieve the same goals using other languages. If anyone has experience building it and can freelance, I'd like to know as well. Our sit...

Have problems designing input and output for a calculator app

Hello! I am writing a button calculator. I have the code split into model, view and a controller. The model knows nothing about formatting, it is only concerned with numbers. All formatting is done in the view. The model gets its input as keypresses, each keypress is a part of an enum: typedef enum { kButtonUnknown = 0, ...

Recognizing Tail-recursive functions with Flex+Bison and convert code to an Iterative form

I'm writing a calculator with an ability to accept new function definitions. Being aware of the need of newbies to try recursive functions such as Fibonacci, I would like my calculator to be able to recognize Tail-recursive functions with Flex + Bison and convert code to an Iterative form. I'm using Flex & Bison to do the job. If you hav...