Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How to add strings to this Code?

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to add strings to this Code?

    Consider having three methods: one to to the F->C conversion, one to do the cm->" conversion, and main() as the third method.

    main() would be quite simple. It would prompt the user and then read what they enter. It would use an if-statement to decide which of the other two methods it would call.

    Packaging separate functionality into separate methods like this helps to give your program some structure.

    ---

    When you post code don't include line numbers as people often copy and paste the code in order to compile it and see it run. But do use the "code" tags. The iea is that you put
     at the start of a section of code and
    at the end. That way the forum software will format the code properly with indents and things and people will be able to read it easily.

    --- Update ---


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: How to add strings to this Code?

    Welcome HARMAN

    Please use code tags when posting code to the forum. See the Announcements page if you need help.

    Please post any questions you have over the assignment.

  3. #3
    Junior Member
    Join Date
    Jun 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Add strings to this code?

    Consider having three methods: one to to the F->C conversion, one to do the cm->" conversion, and main() as the third method.

    main() would be quite simple. It would prompt the user and then read what they enter. It would use an if-statement to decide which of the other two methods it would call.

    Packaging separate functionality into separate methods like this helps to give your program some structure.

    ---

    When you post code don't include line numbers as people often copy and paste the code in order to compile it and see it run. But do use the "code" tags. The iea is that you put
     at the start of a section of code and
    at the end. That way the forum software will format the code properly with indents and things and people will be able to read it easily.

    --- Update ---

    14 }

  4. #4
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    979
    Thanks
    7
    Thanked 206 Times in 182 Posts

    Default Re: How to Add strings to this code?

    Consider having three methods: one to to the F->C conversion, one to do the cm->" conversion, and main() as the third method.

    main() would be quite simple. It would prompt the user and then read what they enter. It would use an if-statement to decide which of the other two methods it would call.

    Packaging separate functionality into separate methods like this helps to give your program some structure.

    ---

    When you post code don't include line numbers as people often copy and paste the code in order to compile it and see it run. But do use the "code" tags. The iea is that you put [code] at the start of a section of code and [/code] at the end. That way the forum software will format the code properly with indents and things and people will be able to read it easily.

    --- Update ---

    Double post. (@OP: don't do this.) I'll merge with the other thread.

Similar Threads

  1. How can i add an image into my source code?
    By joelmeler in forum Java Theory & Questions
    Replies: 14
    Last Post: August 1st, 2011, 07:15 PM
  2. How to add buttons on this code
    By tarell85 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 18th, 2011, 08:08 AM
  3. Add code to an existing project
    By atul.mathur31 in forum Java IDEs
    Replies: 1
    Last Post: January 5th, 2011, 06:50 PM
  4. need to add a Double Button to the code
    By jwb4291 in forum What's Wrong With My Code?
    Replies: 15
    Last Post: August 5th, 2010, 12:19 PM
  5. Help me this code! Someone please explain strings!
    By helpthiscode in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 16th, 2009, 04:13 AM