Click here to Skip to main content
16,006,531 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to build a simple calculator? Pin

MmM.net</

29-Oct-06 3:28

MmM.net</

29-Oct-06 3:28 
GeneralRe: How to build a simple calculator? Pin
aurora5629-Oct-06 3:32
aurora5629-Oct-06 3:32 
GeneralRe: How to build a simple calculator? Pin

MmM.net</

29-Oct-06 3:34

MmM.net</

29-Oct-06 3:34 
GeneralRe: How to build a simple calculator? Pin
aurora5629-Oct-06 3:35
aurora5629-Oct-06 3:35 
GeneralRe: How to build a simple calculator? Pin

MmM.net</

29-Oct-06 3:37

MmM.net</

29-Oct-06 3:37 
GeneralRe: How to build a simple calculator? Pin
Tamimi - Code29-Oct-06 3:40
Tamimi - Code29-Oct-06 3:40 
GeneralRe: How to build a simple calculator? Pin
aurora5629-Oct-06 3:40
aurora5629-Oct-06 3:40 
GeneralRe: How to build a simple calculator? Pin
Colin Angus Mackay29-Oct-06 5:41
Colin Angus Mackay29-Oct-06 5:41 
Here are some pointers:

You need to hold some state somewhere. You also need to hold the fact that the user can type numbers like 98 (the code you showed does not append more digits, it replaces them).

When a use clicks on an operator button (+-/*=) the program needs to store the current display, then it needs to accept a new number. When the user next pressed an operator it performs the function of the operator on the stored value and the current value.

When a user clicks on a digit button it has to append the value on to the other digits received.


AnswerRe: How to build a simple calculator? Pin
Christian Graus29-Oct-06 3:10
protectorChristian Graus29-Oct-06 3:10 
AnswerRe: How to build a simple calculator? Pin
Reuven Elliassi29-Oct-06 9:30
Reuven Elliassi29-Oct-06 9:30 
GeneralRe: How to build a simple calculator? Pin
aurora5629-Oct-06 14:22
aurora5629-Oct-06 14:22 
GeneralRe: How to build a simple calculator? Pin
Christian Graus29-Oct-06 14:46
protectorChristian Graus29-Oct-06 14:46 
GeneralRe: How to build a simple calculator? Pin
Reuven Elliassi29-Oct-06 19:50
Reuven Elliassi29-Oct-06 19:50 
QuestionReading to an array Pin
charchabil0329-Oct-06 1:50
charchabil0329-Oct-06 1:50 
AnswerRe: Reading to an array Pin
Christian Graus29-Oct-06 3:11
protectorChristian Graus29-Oct-06 3:11 
AnswerRe: Reading to an array Pin
Reuven Elliassi29-Oct-06 9:40
Reuven Elliassi29-Oct-06 9:40 
GeneralRe: Reading to an array Pin
charchabil032-Nov-06 0:20
charchabil032-Nov-06 0:20 
GeneralRe: Reading to an array Pin
Reuven Elliassi2-Nov-06 0:32
Reuven Elliassi2-Nov-06 0:32 
GeneralRe: Reading to an array Pin
charchabil032-Nov-06 0:56
charchabil032-Nov-06 0:56 
QuestionError opening Crystal Report! Pin
hfl29-Oct-06 1:09
hfl29-Oct-06 1:09 
QuestionImage Effects in VB.NET Pin
Zaegra29-Oct-06 1:00
Zaegra29-Oct-06 1:00 
AnswerRe: Image Effects in VB.NET Pin
Christian Graus29-Oct-06 1:06
protectorChristian Graus29-Oct-06 1:06 
GeneralRe: Image Effects in VB.NET Pin
Zaegra29-Oct-06 1:15
Zaegra29-Oct-06 1:15 
GeneralRe: Image Effects in VB.NET Pin
Christian Graus29-Oct-06 1:48
protectorChristian Graus29-Oct-06 1:48 
GeneralRe: Image Effects in VB.NET Pin
Zaegra29-Oct-06 2:29
Zaegra29-Oct-06 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.