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: Java assignment help

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

    Default Java assignment help

    Hello everyone, first off, I want to say I'm new to the forums. Thus, this is my first time communicating. That said, I do need some assistance with an assignment. But alas, before I go into details I should probably profess my profficency within Java. I'm adequate to say the least. In regards to basics like variables (Strings, Booleans, Intergers and Doubles) I'm fine with those. Its just I'm having a hard time comprehending the other stuff. I've tried speaking with my professor, but to be not as harsh, his discussions haven't really helped me.

    In fact, they've at times made me more confused. Being that I want to be a programmer this hasn't been a positive experience and since I am in a desperate spot. Alas, I'm probably being very rude right now. I sincerely apologize for the rant and wasting people's time. But anyway, allow me to get onto the assignment. The instructions for the assignment are shown as follows:

    The purpose of this assignment is to continue working with the concepts of encapsulation and container classes.

    In this program, you will

    Define a class called State to model a U.S. state. Each State object will hold several years of population statistics.
    Define a class called U_S_States to function as a container to hold a collection of State objects. (This includes writing a collection of methods for manipulating and displaying any one or all States.)
    Create a main class to act as a client of the above two classes.

    Now, in terms of the problem, he's given us templates for the classes, such as States. My question specifically pertains to arrays. Now, I do know the basics of arrays, specifically being lists which store variables, and their uses with For Loops. But how do you add or subtract them? Specifically, within my program there's a method that states you need to find the change within the two population arrays. All in all, I do apologize if this isn't enough information. If you want me to, I'll post the code here for reference.

    Finally, I read your rules on Spoon-feeding and that is something I do not want. I wish support so as to lead me to a solution. One cannot master something unless he or she is put through the test. All in all, I thank everyone very much for taking the time to read my post.


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

    Default Re: Java assignment help

    Quote Originally Posted by Senonzakura21 View Post
    If you want me to, I'll post the code here for reference.
    Yes, then ask a specific question.
    Improving the world one idiot at a time!

  3. #3
    Member
    Join Date
    Oct 2011
    Posts
    40
    My Mood
    Stressed
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Java assignment help

    in response to: But how do you add or subtract them? Specifically, within my program there's a method that states you need to find the change within the two population arrays. All in all, I do apologize if this isn't enough information. If you want me to, I'll post the code here for reference.

    I believe you're asking how to do a mathematical operation on two numbers located in arrays.
    The real question is how to reference the information in a specific place.

    Lets say you have 2 arrays with data in them

    arrayA { 7, 24, 92, 18}

    arrayB { 48, 12, 2, 1}

    First, you reference items in an array using their index, which starts at 0 and goes to the end of the array.
    For example, the index of 7 in arrayA is 0, while the index of 18 is 3.

    so to actually reference and perform operations on this data, you can say, arrayA[0] instead of saying 7. Or you can say, arrayB[2] instead of saying 12.

    Does that help?

Similar Threads

  1. assignment troubles polymorphism (guide for assignment included)
    By tdawg422 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 8th, 2011, 10:01 AM
  2. Help with a java assignment?
    By rberry719 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: September 30th, 2011, 01:02 PM
  3. [SOLVED] OOP java assignment
    By enkei in forum Object Oriented Programming
    Replies: 1
    Last Post: April 27th, 2011, 11:16 AM
  4. Java Assignment Help
    By welsh_rocker in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 12th, 2011, 06:02 AM
  5. Replies: 1
    Last Post: February 22nd, 2010, 08:20 AM