Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 686 Vote(s) - 3.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gui calculator

#1
I've recently started learning GUI and decided to practice that's why i've decided to start with a simple calculator .

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.



Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


I'm working now on a better version the look is done i still have some calculation code to work on i'll post it when i'm done.
Reply

#2
Nice Project, but here are some recs which will get you pretty far and let you learn alot about how programming works:

make the program so that it will add/subtract unlimited lengths of numbers. An int can only hold 32bits, or 4bytes ( I think, this is what an int holds in Java, correct me if i'm wrong) regardless, an int has a cap on how large of a number it can store. So, for large calculations this is obviously not good.
How about storing the number in a string as it comes in, this means you can store a much larger number. Then, implement a function that will add/subtract. Basically, you're 'implementing' addition and subtraction.

Maybe that makes sense maybe it doesn't. Essentially it's this:
you have a string "1235472364832327432643289464573261"
and another string "384627395074369850846284070978473"

the first question you need to ask is, how do you add/subtract in real life?
well, ya go number by number
1+3 = 4, got it, store that 4 in a string which will be your sum (in such a way that you can add numbers before it.) Maybe a String isn't your best option maybe you can think of something better, but a String would work. It cannot be an int, because an int would be too small to hold the added number.
6+7 = 13 --> here's a problem, because if you put thirteen in as the number, it's not going to add right, so you have to carry over the one. This is where it gets interesting. This also reveals a bit about how a computer's CPU works. There's actually a circuit that needs to deal with carrying over digits.

Hope my suggestion helps~~~



I think you'll be able to figure it out
Reply

#3
Thanks for your comment @insidious15 much appreciated this is a good idea you have here but i'm still on a really early version of this calculator and my whole project is about GUI wasn't much interested in the calculation but yeah your right going for Strings to do the calculation looks good but i think using long instead of int should be enough for a small project (MAX_VALUE of long is 9,223,372,036,854,775,807 ).
i'll update the thread as soon as i'm done with my second version,am already done with the gui and it looks way better.
Still have the calculation to work on .
Reply

#4
Quote:(10-24-2016, 11:41 AM)Vi-Sion Wrote:

[To see links please register here]

Thanks for your comment @insidious15 much appreciated this is a good idea you have here but i'm still on a really early version of this calculator and my whole project is about GUI wasn't much interested in the calculation but yeah your right going for Strings to do the calculation looks good but i think using long instead of int should be enough for a small project (MAX_VALUE of long is 9,223,372,036,854,775,807 ).
i'll update the thread as soon as i'm done with my second version,am already done with the gui and it looks way better.
Still have the calculation to work on .

Nice! Well good luck with it. GUI's were never my thing, have always preferred a CLI.

Cool that you're doing it though, good luck!
Reply

#5
This is how my interface look now and am actually pretty satisfied with it.
Looks much better .

[To see links please register here]

Reply

#6
Done with my update now it does the calculation properly but still quite simple, in this version you can only use small operations with only one operator for example 4+2 4/2 100*56
in the next update i'll try to make it work for operations with many operators 32+2*3-2/5 for example !!
wish me luck guys and feel free to tell me if theres anything wrong with my code or if you need me to add something to make it better.


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

Reply

#7
A very good start man, keep up the good work! I use

[To see links please register here]

to work on my IT skills. Maybe give it a try. I used it as an example when creating my calculating software. But I ended up using this calculator for work because the one I created was to difficult to understand even for me. I added too many useless options that occupied the cache and the program itself stated to work slower. By the way this calculator is completely free and simple to use. I wish you good luck in your beginnings!
Reply

#8
This Is actually well coded for a beginner, although after almost 4 years, I'm sure things have progressed.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through