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

Thread: creating a rainfall class

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy creating a rainfall class

    Write a RainFall class that stores the total rainfall for each of 12 months into an array of
    doubles. The program should have methods that return the follow ing;
    • the total rainfall for the year
    • the average monthly rainfall
    • the month with the DOM rain
    • the month with the least rain


    I dont know how to necesseraily begin I imported my joptionpane class in order to accept user input i need help with the array badly i dont really understand the question can anyone help?


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

    Default Re: creating a rainfall class

    Help? Sure we can help.

    Do it for you. NO!

    What have you done? Post your code. Do you get errors when compiling/running? Post the exact message. Finally ask a specific question. "I don't understand" is not specific and not a question.
    Improving the world one idiot at a time!

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

    Default Re: creating a rainfall class

    I never once said do it for me you tool, i clearly said I don't know where to begin I know this is the type of project that uses 2 classes a driver class and a method class the driver class will call upon the method class to execute the methods which gather user input from the user to get rain amount set rain amount etc. dont talk to me as if im inferior, talk to me with respect.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: creating a rainfall class

    What have you done so far? What specific problems are you having?
    It's hard to suggest anything unless we know where the problems are.
    For example:
    Do you know how to define a class?
    Do you know how to define a method?
    Do you know how to define an array?
    If you don't understand my answer, don't ignore it, ask a question.

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

    Default Re: creating a rainfall class

    Quote Originally Posted by brayanG22 View Post
    I never once said do it for me you tool
    When people just post their assignment and no code that is the general implication we get.
    i clearly said I don't know where to begin
    Then you need to review the basics and maybe talk to your teacher. Online forums work best in helping students with specific problems (eg why a loop or if statement never executes) and not for hand holding.

    --- Update ---

    BTW if anyone generally doesn't know where to start then they should drop the subject.
    class Rainfall {
     
    }
    That is a start. Then continue building the program up bit by bit. Most students try to do the whole program at once and go "ARRRRRRRRRRRRRRRGH! I don't know how to do that". A better approach is to break it down into smaller chunks and work on each chunk separately. make sure you compile your code often and fix all errors before moving on. Another mistake students make is to write 100+ lines of code and get numerous errors which are hard to fix because the code is such a mess.
    Improving the world one idiot at a time!

  6. #6
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: creating a rainfall class

    I know how to finish it i needed help pictuing how the array would be assembled i figured out the program i seperated the tasks into 2 classes then created an object that called that class which contained the methods to get the rain from user a second array was needed to created whivh contained the names of months.

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: creating a rainfall class

    i needed help pictuing how the array would be assembled
    What does "assembled" mean?
    Have you answered these questions?
    What data goes in the array?
    Where does that data come from?
    How many different data elements are saved in the array?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] Help with creating a class and driver
    By JackCannon15 in forum Object Oriented Programming
    Replies: 1
    Last Post: October 27th, 2011, 03:50 PM
  2. Creating and implementing class for creating a calendar object
    By kumalh in forum Object Oriented Programming
    Replies: 3
    Last Post: July 29th, 2011, 08:40 AM
  3. [SOLVED] Creating A Class
    By cb5950 in forum Object Oriented Programming
    Replies: 1
    Last Post: March 31st, 2011, 07:27 AM
  4. [SOLVED] Class Creating Help
    By pitchblack in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 1st, 2011, 11:25 PM
  5. Help with creating a class
    By cdawg_2010 in forum Loops & Control Statements
    Replies: 4
    Last Post: November 1st, 2010, 07:04 AM

Tags for this Thread