Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Homework
Hi...
 
how to create a simple calculator using +,-,*,/ ,clear,dot ,10 buttons and single textbox alone in C#.net web application...
 

Thanks
Posted 23-Feb-11 19:50pm
Edited 24-Feb-11 1:44am
v2
Comments
Nishant Sivakumar at 24-Feb-11 0:54am
   
If this is for a class project/assignment, I'd recommend not doing it. It's too trivial and will not really get you good grades.
 
If you want to do this as an exercise to help you learn, then well this is rather ironic :-)
Abhinav S at 24-Feb-11 6:53am
   
Homework!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Search Google for "JavaScript Calculator" and you will get lots of examples.
 
Okay, let me add some more details:
You need to add buttons for the numbers, dot and operators and a TextBox for showing the result.
For calculation there are two options - Using JavaScript to do it on the client side and other is posting the value to the server and calculating it there. The latter option is not at all recommended. Usually data is posted only when some server side interaction is needed. In this case JavaScript will do everything and server interaction is not at all needed.
 
Try doing it and get back in case you don't understand something.
 
Hope that helps!
  Permalink  
v2
Comments
Prerak Patel at 24-Feb-11 1:13am
   
Good answer, sorry I misunderstood it first. +5
Ankur\m/ at 24-Feb-11 1:14am
   
Thanks!
I was just going to suggest you to remove your answer because that will remove the vote too. :)
Prerak Patel at 24-Feb-11 1:19am
   
I just removed it as it was no way relevant. I completely misunderstood the question.
Ankur\m/ at 24-Feb-11 1:21am
   
Ah it's okay. No worries, it happens sometime. :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Here is mine, full source code: http://www.sakryukov.org/freeware/calculator/[^].
 
—SA
  Permalink  
Comments
Yusuf at 24-Feb-11 7:17am
   
Excellent!
SAKryukov at 24-Feb-11 13:33pm
   
Thank you.
--SA
Pravin Patil, Mumbai at 24-Feb-11 7:50am
   
Brilliant...
Take my 5....
SAKryukov at 24-Feb-11 13:34pm
   
Thank you (can be a bit better, I started to improve, did not finish...)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 245
1 Kamal Rocks 184
2 Sergey Alexandrovich Kryukov 175
3 BillWoodruff 173
4 PIEBALDconsult 160
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 24 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100