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

Thread: Please Can anyone help me, Im new at this and lost

  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please Can anyone help me, Im new at this and lost

    Hey everyone so I just started a intro to computer programming class and we have been given 3 assigments. I have all of them done but one and this is the one that I am totally lost on and dont know where to start or how to do it.

    So please if someone could write the code and show me or tell me or even do an example
    id prefer the code written so I can study each line and learn how to do it and what to do due to the fact Im just learning

    Thanks everyone!!

    this is the assignement
    (input via dialog boxes, output via command window) In this chapter is the code for how to determine a leap year. Use that as part of your code to make this program work correctly

    "Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2012 , the program should display that February 2012 had 29 days"


  2. #2
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Please Can anyone help me, Im new at this and lost

    Firstly you have to break down what they are asking.

    - You need dialog boxes so you should import the javax.swing.JOptionPane

    - It says the code for how to determine a leap year is provided so you should use that comes in handy.

    - Use arrays to hold the number of days for certain months

    - For fields the basic ones you need are: String input(grab input from dialog boxes), Integer month, Integer year.

    I believe this should be enough to get you well started hope this helps.
    Last edited by mrc0ver; October 4th, 2014 at 04:01 AM.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Please Can anyone help me, Im new at this and lost

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    I had the same thoughts as mrcOver but different:

    1. Find the mathematical definition of leap year.
    2. Develop an algorithm to determine if a year is a leap year.
    3. With pencil and paper, choose a number of years and use your algorithm to determine if they are leap years.
    4. Once you're confident that your algorithm is correct, program that part of the assignment: accept any year and report if it's a leap year or not.

    Once you have that part done, it's easy enough to report the number of days in the month of any year.

  4. #4
    Junior Member
    Join Date
    Oct 2014
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Please Can anyone help me, Im new at this and lost

    I am still so lost and dont understand
    im so sorry I know youre trying to help but he just threw this at us with out teaching us leap year or how to calculate

    is there any way you can write the code, So I can look over it and actually learn what to do and what you are trying to tell me what to do

    it would be very much appreciated

    --- Update ---

    I am still so lost and dont understand
    im so sorry I know youre trying to help but he just threw this at us with out teaching us leap year or how to calculate

    is there any way you can write the code, So I can look over it and actually learn what to do and what you are trying to tell me what to do

    it would be very much appreciated

    --- Update ---

    I am still so lost and dont understand
    im so sorry I know youre trying to help but he just threw this at us with out teaching us leap year or how to calculate

    is there any way you can write the code, So I can look over it and actually learn what to do and what you are trying to tell me what to do

    it would be very much appreciated

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Please Can anyone help me, Im new at this and lost

    You won't learn by seeing how someone else does it. Make an effort and ask questions when you have code that you need help with. If unable to start, contact your instructor, a TA, another student, whatever is allowed and encouraged by the class' rules.

Similar Threads

  1. I'm so lost
    By Adam Appleby in forum What's Wrong With My Code?
    Replies: 8
    Last Post: March 23rd, 2014, 05:12 AM
  2. [SOLVED] Have I lost it?
    By pooleman133 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 7th, 2012, 09:22 PM
  3. Help, please. I'm lost
    By Borb in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 17th, 2010, 08:50 PM
  4. I'm lost
    By stoptheerrors in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 31st, 2010, 08:47 AM
  5. lost
    By nyny in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 7th, 2010, 07:32 AM