Is there any C# forum regulars around here?

Status
Not open for further replies.

Chad711

Daemon Poster
Messages
1,444
Location
Irving, TX
Hello,

I just started my very first programming classes at a community college. C# and Java. I'm 33 and my math knowledge has seem to diminish over the years. :hrmph:

Any way the C# class is a online class at my own pace. The instructor so far seems very hard to reach. If I have questions I will wait sometimes half the day before I get a reply. By that time I have either found answers or work arounds on the internet or I've moved on, OR I have 10 more questions by that time! :( My point is I get the feeling a lot of this learning will be on my own and I'm wondering if any one here is savvy with C#? I'm not asking any one to do my homework as I want to learn this on my own. However if I have questions I am wondering if someone can check this thread as I go along and try to help me out here and there?

That would be great. Thanks again!

I made my first program last night. Went pretty well. Pretty simple too, just a little wpf form that calculates area and perimeter of a rectangle.
 
My point is I get the feeling a lot of this learning will be on my own and I'm wondering if any one here is savvy with C#?
I use C# professionally every day, as I have for several years now. Just post your questions when you have them.

As for learning on your own, that is largely how college works -- especially in the third and fourth years and on into graduate school. You are responsible for your own learning. It may take some getting used to, but the learning skills you develop will aid you greatly after you graduate.
 
Thank you so much! I've always been very interested in this and after I made my first app I was pretty excited and proud I could actually do it! I'm taking non-degree seeking classes right now.

I'm taking a Java class right now too. I'm hoping I can handle both languages and don't get to confused in the process. The Java teacher seems much more helpful and responsive. Would you say Java is easier or harder to learn then C#? The first assignment for java seemed very confusing to me and I felt like they were really just throwing me in the cage with out any training. I felt much more comfortable with C#. Guess I need to get to reading the Java book.
 
Would you say Java is easier or harder to learn then C#?
The language syntax is nearly the same. It's just a matter of learning the Java libraries vs the .NET libraries.

That said, it's usually more beneficial to learn one language at a time, especially if it's your first.
 
Ok quick question, probably a dumb one too but I'm learning! This is java but I'm sure it's the same with C# any way...

What is the code if I'm trying to say a variable remains unchanged? In this example basically I'm adding code to a bank account function where if they make a withdraw and that amount is more then the balance then the balance remains unchanged.

Here is what I have and I'm stuck. The "initialBalance" variable is from a different "method" (think that is what it's referred to) and so it doesn't recognize it.

Here is my code:

Code:
 //debit an amount from account
   public void debit (double withdraw)
   {
       balance = balance - withdraw; //subtracts amount from balance
       if ( withdraw > balance )
           balance = initialBalance;

If you need the rest of the code let me know but I'm thinking this should be enough to get the idea.

Thanks!
 
I do believe it would be an if/else statement. So I am thinking you keep your IF lines the same, and then put in the ELSE (capitalized for clarity, not to be caps though). See where I am going with it ? You are on the right track. Something like:

Code:
   public void debit (double withdraw)
    //subtracts amount from balance
     balance = balance - withdraw; 
   {
       if ( withdraw > balance )
            newBalance = initialBalance;
       else (withdraw <= balance)
            newBalance = balance;
   }

I am a little rusty on programming these days, getting back into it, so you might have to adjust something there, like brackets. Either Jaeusm or Baez or kmote should be able to help with this, I am not an authority but I think you can see what I am trying to point out hopefully.

Lol ! I probably hosed it, forget my blurb, someone else should help you. Sorry :p
 
Yeah I see what you mean there and thanks for the bit of info. However initialBalance is a variable declared inside another method so I can't use it. If it was a class variable I could but no such luck on this assignment! :(
 
How about a global variable ? I don't know about in Java, but in VB (and I am thinking it would be true for Java as well) that you can make a global variable and it can be used in anywhere in the program. Maybe something like that might help?
 
Yeah but this is an assignment and I don't think I can change it to a global one. I think...

I'm suppose to add code to do a withdraw. I don't think they want me changing the other code to work around it??
 
Status
Not open for further replies.
Back
Top Bottom