raghav.naganathan's Profile User Rating: *****

Reputation: 408 Architect
Group:
Greeters
Active Posts:
1,434 (2 per day)
Joined:
14-September 12
Profile Views:
91,050
Last Active:
User is offline Mar 08 2013 04:40 AM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   raghav.naganathan has not set their status

Posts I've Made

  1. In Topic: Wrapper classes

    Posted 8 Mar 2013

    View Postlouisianapadawan, on 08 March 2013 - 04:01 PM, said:

    View Postbaavgai, on 08 March 2013 - 03:12 AM, said:

    How exactly are wrapper classes involved here?

    Also, if you're using Scanner, why aren't you using nextInt()?


    I'm using Scanner to get a string from the user. This allows the user to enter any number they want (double) and not just ints. The wrapper takes that string and stores it as an Integer which will then allow me to perform a math operation with it.


    Well, that can be done, but even if you use Double.parseDouble() method for getting a double value from a string, there will be a problem when you use the % operator as % operator will only work with integer values.

    regards,
    Raghav
  2. In Topic: Wrapper classes

    Posted 8 Mar 2013

    Also, how is the sum of the digits involved in your code?

    A small hint I can give you is you need to use the % operator in your for loop.

    regards,
    Raghav
  3. In Topic: Wrapper classes

    Posted 8 Mar 2013

    View Postjjh08, on 08 March 2013 - 03:34 PM, said:

    You have to import the Integer wrapper class. The compiler can't see the static method parseInt()
    import java.lang.Integer
    

    Place the import statement at the top of your code.


    Well, not really. The program will work even if you don't do the import.

    The problem was happening because he was not specifying a string parameter to Integer.parse method.

    regards,
    Raghav
  4. In Topic: Wrapper classes

    Posted 8 Mar 2013

    Well, that is because Integer.parseInt takes string as parameter and the variable you are storing the result in should be an integer variable.

    I would suggest you do something like this.

    for (int i = 0; i <1; i++) 
    {
      int newNum = Integer.parseInt(num);
      System.out.println(newNum);
    }
    


    regards,
    Raghav
  5. In Topic: If statements

    Posted 8 Mar 2013

    View PostSplinteredChaos, on 08 March 2013 - 02:46 PM, said:

    I was under the assumption that with if statements the section enclosed in the curly braces only executed if the condition proved true. Meaning if(a = 1) { cout << "you rock" << endl; } would only execute if a did indeed equal 1. Otherwise if the condition were false it would move on to the next section of coding. The above coding sometimes applies the +1 to the variable even when the condition proves to be false.


    Well, you need to note here that if(i=1) is very much different from if(i==1)

    The first one '=' is assignment operator and the condition will be true every single time as if( any number other than 0) always returns true.

    The second one '==' is the relational operator and will be true only if i equals one.

    regards,
    Raghav

My Information

Member Title:
Perfectly Squared ;)
Age:
23 years old
Birthday:
December 16, 1990
Gender:
Full Name:
Raghav Naganathan
Programming Languages:
C, C++,Java, little of Javascript and PHP

Contact Information

E-mail:
Click here to e-mail me

Comments

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  1. Photo

    Xupicor Icon

    03 Jun 2013 - 12:03
    How's it going Ragh? :) I see you've got an online romance on your hands. Neat. ;)
  2. Photo

    raghav.naganathan Icon

    08 Mar 2013 - 03:23
    400 it is!!! Thank you jjh08 :)
  3. Photo

    raghav.naganathan Icon

    24 Feb 2013 - 23:31
    Well, it sure is a fake...:P
  4. Photo

    aresh Icon

    20 Feb 2013 - 14:43
    Lolz! You now have an online lover! :P
  5. Photo

    mamelove25 Icon

    19 Feb 2013 - 10:50
    Hello My Dear, My Name is Mame. i saw your profile today and became interested in you,i will also like to know you more,and if you can send an email to my email address,i will give you my pictures here is my email address (mame25live@yahoo.co.uk) I believe we can move from here! Am waiting for your mail to my email address above because i have much to tell you,
    love Miss Mame.
  6. Photo

    raghav.naganathan Icon

    13 Feb 2013 - 00:44
    Well, good observation indeed :) I guess that is because I am a cheerful person by nature :)
  7. Photo

    aresh Icon

    12 Feb 2013 - 12:11
    Oh, and every comment also has excess of :) in it :P
  8. Photo

    aresh Icon

    12 Feb 2013 - 12:10
    Have you observed something strange? Every comment of yours ends with a :) !!!
  9. Photo

    raghav.naganathan Icon

    11 Feb 2013 - 20:53
    Most welcome :) It was well deserved indeed! :)
  10. Photo

    andrewsw Icon

    11 Feb 2013 - 05:57
    Thank you again for your support and encouragement.
  11. Photo

    raghav.naganathan Icon

    08 Feb 2013 - 00:58
    300 it is :) Thank you lepazoga :)
  12. Photo

    Xupicor Icon

    07 Feb 2013 - 17:32
    http://vulpeslibris.wordpress.com/2011/12/07/lost-fleet-dauntless-by-jack-campbell/
    "The Living Stars" are a part of widespread in-world religion, one that I at least see some sense.
    Two, well, see this: http://www.starlarvae.org/
  13. Photo

    raghav.naganathan Icon

    20 Jan 2013 - 20:14
    Well Xupi, I didn't get it either...care to explain?
  14. Photo

    aresh Icon

    20 Jan 2013 - 18:17
    That's no fair! I didn't get it! :'(
  15. Photo

    Xupicor Icon

    20 Jan 2013 - 09:08
    I may be MIA, but not confirmed KIA yet :P By the living stars, I will get back online some day. ;] (If you get that reference, you score +1 in geek :P)
  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »