• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

No programming experience, need some guidance choosing language.

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
namespace WindowsFormsApplication1

private void btnDivide_Click(object sender, EventArgs e)
{
total1 += total1 / double.Parse(txtDisplay.Text);
txtDisplay.Clear();

theOperator = "/";
}


Found one problem.. the total1 +=.. I took the plus out (not sure why I had it there to begin with), but the equal still doesn't work on anything other than add 🙁
 
Found one problem.. the total1 +=.. I took the plus out (not sure why I had it there to begin with), but the equal still doesn't work on anything other than add 🙁

Ok, so a few questions for you.

What does total1 represent?
When should the addition/division/subtraction occur? When you click the add/divide/subtract button or at some later date?

Try to think through exactly what happens when you click a button, write down what variables store if you have to.
 
the total1 represents the first number of the equation. total1 would be 5 + total2 would be 5.. at least, that's how the instructor said to set it up.

the addition/subtraction/etc -should- occur when the equal sign is hit, shouldn't it? I mean, if I am not mistaken that is the concept behind the switch and case right? The switch in this case being theOperator, and each case under the btnEqual area would represent the addition/subtraction/etc.

Ok...now i'm all sorts of confused! LOL.. my brain hurts..haha
 
the total1 represents the first number of the equation. total1 would be 5 + total2 would be 5.. at least, that's how the instructor said to set it up.
Ok, you'll want to get a better understanding of what what total1 and total2 are representing. I would suggest rereading the text about these variables and get a better understanding of what they store.

the addition/subtraction/etc -should- occur when the equal sign is hit, shouldn't it?
Correct. It can be done a different way, but for now, this is how you should do it. You should know, that you aren't just performing a math operation when the buttons are pushed, rather, you are doing math operations every time a math button is pushed.

In other words, the +,-,*, and / buttons are all doing more than they should.

I mean, if I am not mistaken that is the concept behind the switch and case right? The switch in this case being theOperator, and each case under the btnEqual area would represent the addition/subtraction/etc.

Ok...now i'm all sorts of confused! LOL.. my brain hurts..haha

You are on the right track. Programming, especially in the early stages, will cause all sorts of brain strain.
 
Thanks a lot for the guidance Cogman! I've actually been doing the training exercises since midnight, and I think I just need to step back for a few hours and get some rest. Come at my problem with a fresh brain. I will -definitely- look over the variables of total1 and total2, and how they work. It may be something I'm over looking, or need to change since I changed from if...else commands.

Thanks again man! You're the best.

Luzah
 
To OP
I don't want to be rude, but your atitude is wrong: your only motivation seems to be getting a job as programmer -I think it doesn't work that way. Motivation should be "how stuff works".. If you're curious enough and ready to spend hours per day for learning (for next several years), then picking "right" programming language is trivial.

Just my 2c -after being a hobby programmer for about 30 years (and still learning).
Bogdan
 
My attitude isn't wrong, Bog. I -mentioned- that I would like to shoot for a career later on in life (let's be realistic here, and say that I would be stupid NOT to at least -try- for one if I take the time to learn programming), but I also mentioned something about wanting to learn general programming and even dropping vb.net because it felt "dumbed down" to me, and picking up and C# and "having a blast". To be honest, that doesn't sound a whole lot like a career-oriented mind to me but rather me wanting to challenge myself to the best of my ability. I do understand what you're trying to say, and I assure you that a career is not the entire reason I want to pick up programming. College will come way before a career ever will with me 🙂 Thank you for your input!
 
To Luzah:
I understand now -thanks for taking time to explain. What to say... pick a language and don't give up 🙂

Bogdan
 
Get a course on C. Once you understand C, you can pretty much do anything else.

C is to programming as the Grand Unified Theory is to physics. You can understand some aspects of physics without knowing GUT, e.g., Newtonian motion, but underlying everything is C.

(Ken, please show up now and assert the above, except for s/C/ASM/g) 😉
 
I agree that VB.NET is not a good choice. I work with people who cut their teeth on VB and cry when they see a curly brace.

Jump in to C#. Same excellent development tools as VB.NET and less work to get something up and running than Java. Switching between C# and Java is cake.
 
Whatever you choose make sure you pick up some general programming basics else you could end up like the "experienced" guy who wanted to take a job at our company and did something like this:

if ()
{
if ()
{
}
}

After a few hours he gave up and asked for peer tips.

After this we kind of suspected that he kind of exaggerated regarding his former experience.
 
C or C++ or Java.

A lot of people recommend Head First books. Just look up Head First C, Head First Java, etc. in Google or at your local library
 
Back
Top