lmao i take ss show uBoredness wrote:NPNTRavenOfDeath wrote:i could code a scientific calc.
[Delphi]Program a Simple Calculator
Moderator: wizme
- RavenOfDeath
- Headmaster of Darkness
- Posts: 725
- Joined: Mon Feb 08, 2010 6:43 pm
Re: [Delphi]Program a Simple Calculator
Goals:
Top 10 poster in Xemectrum [V]
Top 5 poster in Xemectrum [X]
Top 3 poster in Xemectrum [X]
Top poster in Xemectrum [X]
Top 10 poster in Xemectrum [V]
Top 5 poster in Xemectrum [X]
Top 3 poster in Xemectrum [X]
Top poster in Xemectrum [X]
Re: [Delphi]Program a Simple Calculator
isnt it the same just the cal method diff ? ...
Unlike science, love is like magic, there's no reason to it - wizme =)
Learn more of security, click here =)
Learn more of security, click here =)
- RavenOfDeath
- Headmaster of Darkness
- Posts: 725
- Joined: Mon Feb 08, 2010 6:43 pm
Re: [Delphi]Program a Simple Calculator
yes...wizme wrote:isnt it the same just the cal method diff ? ...

Goals:
Top 10 poster in Xemectrum [V]
Top 5 poster in Xemectrum [X]
Top 3 poster in Xemectrum [X]
Top poster in Xemectrum [X]
Top 10 poster in Xemectrum [V]
Top 5 poster in Xemectrum [X]
Top 3 poster in Xemectrum [X]
Top poster in Xemectrum [X]
-
- Master of Darkness
- Posts: 431
- Joined: Sat Dec 12, 2009 9:01 pm
- Location: Heaven !
- Contact:
Re: [Delphi]Program a Simple Calculator
heres the code in VB
just dumb 2 text box and 1 button and paste the code.....
tada a calculator XP
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
A detailed explanation on each line of code would be helpful
Eg. like what this simple code actually do and stuff

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
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
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