Results 1 to 3 of 3
  1. #1
    Javreg is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default Basic Java programming HELP!

    Hi I'm new to Java and I have this assignment I have to complete.

    1) How do I use a "for loop" statement to write a program that stores the sum of the first 10 positive integers, 1+ 2 + 3 + ... + 8 + 9 + 10 in an int variable, and displays the total as the sum progresses? i.e. 1,3,6,10, .....

    2) I have to write a program that prompts the user for an integer number. The program should determine whether or not the number is even, and then inform the user of its conclusion.
    Aaand write the program so that the program will continuously prompt the user to input a number until the user has successfully provided an even number.

    3) I have to write a program where the computer knows a random number between 1 and 100 and the user is the guesser. At the end of the game, the computer displays the number of guesses required by the user to guess the number correctly.

    4) An employee's total weekly pay equals the hourly wage multiplied by the total number of regular hours for that week plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a program that takes as inputs the hourly wage, total regular hours for the week, and total overtime hours for the week, and displays an employee's total weekly pay for that week.

    Can anyone help me with at least 1 of the programs?
    Thank you

  2. #2
    yellowledbet is offline Senior Member
    Join Date
    Feb 2011
    Location
    Georgia, USA
    Posts
    122
    Rep Power
    0

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Basic Java programming HELP!

    Quote Originally Posted by Javreg View Post
    Hi I'm new to Java and I have this assignment I have to complete.

    1) How do I use a "for loop" statement to write a program that stores the sum of the first 10 positive integers, 1+ 2 + 3 + ... + 8 + 9 + 10 in an int variable, and displays the total as the sum progresses? i.e. 1,3,6,10, .....

    2) I have to write a program that prompts the user for an integer number. The program should determine whether or not the number is even, and then inform the user of its conclusion.
    Aaand write the program so that the program will continuously prompt the user to input a number until the user has successfully provided an even number.

    3) I have to write a program where the computer knows a random number between 1 and 100 and the user is the guesser. At the end of the game, the computer displays the number of guesses required by the user to guess the number correctly.

    4) An employee's total weekly pay equals the hourly wage multiplied by the total number of regular hours for that week plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a program that takes as inputs the hourly wage, total regular hours for the week, and total overtime hours for the week, and displays an employee's total weekly pay for that week.

    Can anyone help me with at least 1 of the programs?
    Thank you
    Sure, we can help, but first you must ask an answerable question or two. So far, all I see is an exact listing of your assignment and no discernible question. Certainly no one is going to do any of these for you (and if they do, us moderators will be sure to delete the answer immediately), but without a specific question, about all we can do is direct you to the tutorials.

    So please come on back, show your work including your current code surrounded by [code] [/code] tags, and some answerable questions and we'll be glad to help.

Similar Threads

  1. Basic Java help, AIM?
    By jkswebsite in forum New To Java
    Replies: 4
    Last Post: 07-11-2012, 07:17 PM
  2. [ASK] Need help about java basic T_T
    By shezars in forum New To Java
    Replies: 5
    Last Post: 03-09-2012, 05:22 AM
  3. Java Basic
    By Anveshan in forum New To Java
    Replies: 6
    Last Post: 05-06-2011, 10:45 AM
  4. need help with basic programming assignment (with arrays)
    By magictricks1020 in forum New To Java
    Replies: 11
    Last Post: 05-03-2011, 03:19 AM
  5. Basic java
    By santa in forum New To Java
    Replies: 5
    Last Post: 11-16-2009, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •