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

Thread: HELP WITH HOMEWORK!!

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Location
    North Carolina, United States
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP WITH HOMEWORK!!

    HELP ME WITH A PROBLEM,,,, A VERY SIMPLE PROBLEM...


    1. Design and implement a class called Dog that contains instance data that represents the dogs name and age.
    2. Define the Dog constructor to accept and initialize instance data. Include getter and setter methods for the name and age
    3. Include a method to compute and return the age of the dog in "person years" (seven times the dogs age)
    4. Include a toString method that returns a one-line description of the dog.
    5. Create a driver class called Kennel, whose main method instantiates and updates several Dog objects.



    PLEASE HELP ME!!


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: HELP WITH HOMEWORK!!

    Not that you wanted someone to, but this is not a place where people just do homework for you.

    So what is it you need help with?

  3. #3
    Junior Member
    Join Date
    Oct 2012
    Location
    North Carolina, United States
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP WITH HOMEWORK!!

    I am lost on how to create the toString, that's all. Was hoping to see the flow of the program to see if it makes sense. My teacher is terrible.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: HELP WITH HOMEWORK!!

    I am lost on how to create the toString
    Are you familiar with the toString method? Take a look at the Object class, which every class inherits from, which has a toString method, that every class can override to return a customized String.

    My teacher is terrible
    To quote KevinWorkman's article, which I recommend reading:

    Don’t: Blame the teacher. Plenty of people learn on their own without the benefit of a teacher, classmates, or a classroom. Saying things like “my teacher never explained this!” is just a waste of time. The answer is out there- find it

Similar Threads

  1. Homework help
    By hockey15 in forum Object Oriented Programming
    Replies: 3
    Last Post: September 23rd, 2012, 11:28 PM
  2. I am doing my homework =D
    By valenciajv in forum Java Theory & Questions
    Replies: 9
    Last Post: October 7th, 2011, 04:39 PM
  3. Homework
    By jdonaldson in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 9th, 2011, 11:09 AM
  4. need help with homework!
    By programmer12345 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 27th, 2009, 05:34 AM
  5. [SOLVED] What is cast operator and how to use it?
    By napenthia in forum Java Theory & Questions
    Replies: 11
    Last Post: April 27th, 2009, 06:11 AM