Create Your Own Calculator Tutorial Part 2 – C Sharp Visual Studio 2008
to create your very own calculator similar to the windows calculator. Not only will you make a useful program but learn a lot of things that C# can do. If you have anything you need to learn with c# leave a comment or head to my forums and I will make a video of me doing it. WEBSITE: www.Quack-Ware.com FORUM www.Quack-Ware.com SUBSCRIBE TO MY VIDEOS … “visual studio” “c sharp” c# visual studio 2008 “visual studio 2008″ programming tutorial “c sharp tutorial” “visual studio tutorial” “c# …
Works nice. Found a problems. Crashes when you do divide by zero. Not that anyone should divide by zero still if it gets accidentally hit then instead of crashing might want to just have the program say ‘undefined’
you need to reset the equal bool to false in the + – * and / methods just throw in an if statement like this
if (equal)
{ equal = false
}
its really interesting
P.S.
It only continues if I use the same operation.
After one equation you can’t continue off the new value, you need to retype the number. How can I resolve this?
he he i realised that you hadn’t done the other things at 1.33 ;P
anyway awesome vid, it helped me loads
Awesome job man, Definitely helped me out in my programming class.
I would have been lost without your tutorial!
Thx for the videos!
I’ve got an error, pls someone help me..
The calculator works perfect with integer numbers (for example 10+5=15), but if I try this: 1.1+2.2 I’ve got an error..
What’s wrong?
textBox1.Text = “”;
textBox1.Tag = “”;
all u need in clear button :p saves time ^^
Awesome!!! Very simple and to the point video and i really like the way you present it thumbs up man!
Can you please make a video series on C sharp tutorial on VS 2008 like the one bob tabor had with some small project.
that would be very awesome!
Thanks a lot man.
). You should really add
This was my first program (except HelloWorld
plus = minus = multiply = devide = false;
at the end of your equal button code cuz if i add something fort and multiply something after you will get some funky results
remember in programming this is only a variant idea to develop, you can do this calculator in another way
for some reason the 0 doesn’t work for me.
Any questions?
TY!!! ^^
Great job, you missed one thing. There is not error checking for “division by zero”. If you type a number and then divide it by 0, you program will crash.
please post your website addressso that we can subscribe to your videos.You re doing a great job it helps beginners like me learn fast
How can I program the calculator to add like this:
i click 1 it shows 1
i click add
i click 12 it shows 12
i click add it shows 13 etc.
so that it keeps doing it without the equal button.
plz reply.
Make a tutorial plz
Its really nice work u done i learn it so easly
thanks for that
can u please do some work on classes and methods i m a bit confuse on that thanks
and will b waiting for next video
Thanks
if (plus)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) + Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
plus = false; // add this
}
Do the same thing with the other three minus, multiply and divide.
I tried to use comas, but it didn’t work for me.
Where do I have to insert that code?
Superb tutorial.You’ve explained it so well. I liked it
Great video!.. good quality..
rather than creating 4 variable:
(plus, minus, multiply , divide)
you can create one variable call mode and store (plus, minus, multiply , divide) as the value and use a switch statement at equal method.