Page 2 of 2

Re: [Delphi]Program a Simple Calculator

Posted: Tue Mar 09, 2010 4:06 pm
by RavenOfDeath
Boredness wrote:
RavenOfDeath wrote:i could code a scientific calc.
NPNT
lmao i take ss show u

Re: [Delphi]Program a Simple Calculator

Posted: Tue Mar 09, 2010 4:13 pm
by wizme
isnt it the same just the cal method diff ? ...

Re: [Delphi]Program a Simple Calculator

Posted: Tue Mar 09, 2010 11:00 pm
by RavenOfDeath
wizme wrote:isnt it the same just the cal method diff ? ...
yes... :lol:

Re: [Delphi]Program a Simple Calculator

Posted: Fri Apr 02, 2010 10:49 am
by PIEzLOVERS
heres the code in VB

just dumb 2 text box and 1 button and paste the code.....
tada a calculator XP

Code: Select all

Public Class Form1

    Private Function AddTwoNumbersResult(ByVal first As Integer, ByVal second As Integer) As Integer

        Dim answer As Integer
        answer = first + second
        AddTwoNumbersResult = answer

    End Function


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim first As Integer
        Dim second As Integer
        Dim result As Integer

        first = Val(TextBox1.Text)
        second = Val(TextBox2.Text)
        result = AddTwoNumbersResult(first, second)
        MsgBox("The answer is " & result)
    End Sub
End Class

Re: [Delphi]Program a Simple Calculator

Posted: Wed Jun 23, 2010 2:32 am
by KFSPC8
A detailed explanation on each line of code would be helpful :)
Eg. like what this simple code actually do and stuff

Code: Select all

procedure TForm1.BtnPlusClick(Sender: TObject);
begin Handleop('+'); end;

Re: [Delphi]Program a Simple Calculator

Posted: Wed Jun 23, 2010 2:31 pm
by zile
if you want to code a scientific a calculator in c++, a calculator that can calculate the input of "1*61+(6/2)*82+6" correctly
use Shunting-Yard Algorithm to convert the input to Reverse Polish Notation, then code a Reverse Polish Notation calculator to solve it

if delphi has vectors/list, then you can do it there too