Wednesday 30 September 2015

noob needs assistance Please be noob friendly.



Hello everyone. My name is tony. First off sorry for being a noob. I should have been learned this. I would like to ask if i could get some help. I want to create a simple calculator that just has a GUI with a grid like layout of clickable buttons at the lower-left-hand side of the activity that has the value 0-9,addition, subtraction,
multiplication,division,decimal, percentage,calculate,clear and clear all . I would like a Text-view above the buttons to display the values of the buttons when clicked. I also would like the result of the calculation to be in the upper right hand corner of the screen that fades in when the user clicks the calculate button .I have searched around and have looked at lots of source code for calculators but there not really "nooob friendlyy"

Some Logic of what im wanting:

user click numbutton -> button pushes its value to Text-View -> user click numbutton -> button pushes its value to Text-View
->user clicks an operand-> Text-View clears its Text on next numbutton press (but still holding that prior value the user entered)->user clicks another numbutton (if they clicked a numbutton it's value would be set to the text-view) or the calculate button -> calculate the two values using the clicked operand and set it to the TextView Result->TextView Result fades in at the top right hand corner of the activity.


Here is were i get:confused:

(1)I'm trying to use int/longs and float/doubles depending if the decimal is in the text view when the user clicks the operand.
if is there, expect and return floats and if not, expect and return int's.
(2)parse commands parseInt().gettext().tostring coverts the int to string and respectively for the other data types correct?Is there some benefit to covering to strings?


If anyone could help it would be greatly appreciated. I really would like some code though. Heavily commented for a noob. I feel like its the only way ill learn. I will say that i am starting to see more and more of the puzzle and how the pieces come together. Its exciting. Multiple welcome.

P.S. I would just go to college or a code camp but due to insane family situations ,the environment i am around and not having any of my own income, i am unable to attend(F.A. issues). Its not that coding isn't fun. I know i could do this for hours and infidelity plan to. But if i leave my things at anytime i have a serous risk of my items being stolen...



No comments:

Post a Comment