Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Reading a book about C#. (newbie question)
Closed Thread
Old 04-10-2009, 12:27 AM   #21 (permalink)
Chad711's Avatar
 
Monster Techie

Join Date: Oct 2008

Location: Irving, TX

Posts: 1,175

Chad711 is on a distinguished road

Default Re: Reading a book about C#. (newbie question)

Thanks for that. Funny I was just reading about escape sequences the other day. It's where my bookmark is right now!

Has a list of them:

\'
\"
\\
\0
\a
\b
\f
etc etc....

Guess it's the same in Java as \t is horizontal tab
__________________
Q6600 OC 3.0, 4870 1GB,750w, 4GB DDR2, T-Power I45, Extreme Audio X-Fi OS: Windows7-64-Pro, Contact Core Freezer, Acer G24"/LG 22"
Chad711 is offline  
Old 04-10-2009, 12:37 AM   #22 (permalink)
Logarithms's Avatar
 
Banned

Join Date: Apr 2009

Posts: 41

Logarithms is on a distinguished road

Default Re: Reading a book about C#. (newbie question)

Cool.
Logarithms is offline  
Old 04-10-2009, 12:55 AM   #23 (permalink)
 

Join Date: Jul 2005

Location: England

Posts: 2,159

kmote has a spectacular aura aboutkmote has a spectacular aura about

Default Re: Reading a book about C#. (newbie question)

Quote:
Originally Posted by Logarithms View Post
What part of it?

edit: Oh, I put "result double = 0;"
Yes, there was that. There is also your while loop. You've made it better but I don't think you want that semicolon there. You should also consider using String.format here System.out.println("The result of your addition was "+result+". \n");


My lazy attempt at this example essentially places the user in an infinite loop allowing them to specify very large positive or negative numbers to be added to a running total, hitting enter displays the running total as it stands.

Code:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JOptionPane;
import java.math.*;

public class Main {

    public static void main(String[] args) {
        try
        {
            BigDecimal accumulatedTotal = new BigDecimal(0);
            int i = 1;
            BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
            while(true)
            {
                try
                {
                    System.out.print(String.format("Enter value %d here (hit enter to see current total): ", i));
                    BigDecimal inputVal = new BigDecimal(buff.readLine());
                    accumulatedTotal = accumulatedTotal.add(inputVal);
                    i++;
                }
                catch (NumberFormatException ex)
                {
                    System.out.println(accumulatedTotal.toString());
                }
            }
        }
        catch (IOException ex)
        {
            JOptionPane.showMessageDialog(null, "Oh Dear");
            ex.printStackTrace();
        }
    }

}

__________________
MSI P43 Neo|Enermax Pro82+ 425W|E5200|silent 8500GT|250GB Samsung spinpoint F1|Samsung SATA DVD RW|4GB Corsair|Antec SOLO|openSUSE11


There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page
kmote is offline  
Old 04-10-2009, 08:39 AM   #24 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default Re: Reading a book about C#. (newbie question)

Quote:
I think C# is more complex because it lacks a real open-source community or an inviting active community. I mean if you take a look at forums, then you will see that there is always an abundance of people who know Java. How many know C#?
I don't think an open source community has any impact on whether a language is complex or not. As for forums, people who are using Microsoft languages typically frequent the MSDN forums rather than general programming forums like this one.

To get a better feel for which languages are most popular in industry, do a job search (Monster.com, Dice.com) using the language as a keyword. There are quite a few C# jobs as well as Java jobs.
jaeusm is offline  
Old 04-10-2009, 11:38 AM   #25 (permalink)
Logarithms's Avatar
 
Banned

Join Date: Apr 2009

Posts: 41

Logarithms is on a distinguished road

Default Re: Reading a book about C#. (newbie question)

Quote:
Originally Posted by jaeusm View Post
I don't think an open source community has any impact on whether a language is complex or not. As for forums, people who are using Microsoft languages typically frequent the MSDN forums rather than general programming forums like this one.

To get a better feel for which languages are most popular in industry, do a job search (Monster.com, Dice.com) using the language as a keyword. There are quite a few C# jobs as well as Java jobs.
I guess you're right. It must be my bias that leads me to believe that C# is more complex.
Logarithms is offline  
Old 04-10-2009, 12:46 PM   #26 (permalink)
 
Newb Techie

Join Date: Mar 2009

Posts: 17

racerx69 is on a distinguished road

Default Re: Reading a book about C#. (newbie question)

Good idea about hitting the job boards and doing some searches on each langauge. If there is no jobs using a certain language then it could be a complete waste of time learning it.
racerx69 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
32-bit WinXP question, regarding RAM White_Wolf Windows Operating Systems and Software 1 12-21-2008 03:19 PM
Extreme newbie here, grateful to have found you and with a question: DRPS05 Programming Discussions 5 12-19-2008 09:00 PM
Samba Questions - Can I use "test" as an acct? + Home Dir Mapping Question. Jayce Linux, BSD, other *nixes & Open Source Software 0 12-01-2008 05:14 AM
Get this book Oreo Off Topic Discussion 3 07-30-2008 03:27 PM
Quick LCD panel question. Akubane Building, Buying, or Upgrading High Performance PC Systems 2 04-08-2008 02:07 PM