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 3 of 3

Thread: PLEASE PLEASE I AM STUCK...

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I am having a difficult time Looping

    My teacher made up his own problems, and I need help with 2 of them, I know absolutely nothing about Java loops.

    First Problem.

    Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits. For example, the program should: output the individual digits of 3456 as 3 4 5 6 and the sum of the digits is 18...

    Second Problem.

    Write a program that uses a while loop to perform the following steps:

    a) Prompt the user to input 2 integers: firstNum secondNum, firstNum must be less that the second

    b) Output all odd numbers between the firstNum secondNum

    c) Output the sum of all even numbers between firstNum and secondNum

    d) Output the numbers and thier square of odd numbers between firstNum and secondNum

    e) Output all uppercase letters
    Last edited by ThejavaBUM; April 5th, 2011 at 10:21 AM. Reason: Asking Question a little better


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: PLEASE PLEASE I AM STUCK...

    See my signature on asking questions the smart way. Your post title is liable to be ignored, and you haven't provided us any indication of what you've tried so far.

    I recommend you start by reading through this: Control Flow Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: I am having a difficult time Looping

    Quote Originally Posted by ThejavaBUM View Post
    e) Output all uppercase letters
    WTF has that got to do with the other 4 tasks?

Similar Threads

  1. Stuck again
    By Tate in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 28th, 2010, 11:22 AM
  2. Stuck help please!
    By mindlessn00b in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 5th, 2010, 05:31 PM
  3. I am stuck
    By hawkman4188 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 29th, 2010, 12:46 AM
  4. Stuck :(
    By hing09 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 17th, 2010, 05:20 PM
  5. I'm stuck
    By iank in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 5th, 2009, 10:21 AM