Please help!!!!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Please help!!!!

  1. #1
    Join Date
    Aug 2005
    Posts
    2

    Unhappy Please help!!!!

    Within the package define a class called Helper, containg the following methods:
    a) A constructor (with one parameter, name).
    b) A constructor (with two parameters, name and hours worked).
    c)getHours - method returns the number of hours worked.
    d) setHours- private method sets the number of hours worked
    e) getALL - prints all the data feilds with 1 record ( name, hours_ per line.

    the private member data fields are called name and hours. There are no othger methods in this class at this stage.

    I am just beginning learning java, and this is just the first part of a long list of questions, so if someone can help me with the start, then i can do the rest. thankyou so much.

  2. #2
    Join Date
    Jul 2005
    Location
    SW MO, USA
    Posts
    299
    What is your question? I usually recognize them because they end with a ?
    Does your text book have any examples? Can you tailor one of them to get started with your problem? If you'll do that and then ask questions on how to make your program do what you want it to do, then we'll help.
    So get started and post what you have to date with your questions about how to make it to what is needed.
    Good luck.

  3. #3
    Join Date
    Oct 2004
    Posts
    151
    Hi everyone,

    I have got to agree with norm on this one. What is your question?

    Richard West
    What type of softwares do you like and what would you pay for it?

    http://www.wizardsolutionsusa.com/fo...hread.php?t=12

  4. #4
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    Kelly:

    You have almost all the information you need to define your Helper class - you have data members and you have methods. Look at your instructional materials and study how classes are defined, and copy that pattern with your Helper class.

  5. #5
    Join Date
    Aug 2005
    Posts
    2

    Red face Sorry!!!!!

    Sorry, it goes on to say:

    Test the just defined class using another class HelperWork, which uses the following data: (Tim Brown worked 35 hours)

    Tim Brown 35


    In other words create an object , called creature, of type Helper with the above values and display theses values on screen. The values form a part of the java code. This class contains only the main method with no further methods will be added here.

    Next, create 2 arrays Names and Work containing the names and hours, given below ( data are part of the program, they are not entered by the keyboard):

    Tim Brown 35
    Jack Blink 50
    Pat Gold 34
    Jim Done 22
    Eloise Tricot 71

    Modify your main method and create an array of Helper class objects, using the arrays Names and work representing 5 helpers with hours each of them worked.

    (2)Write a method "alterHours" that increase the hours by 20%?

    Modify the variables storing the hours worked by Pat and Eloise, using the "alterHours" method, display the new values.

    (3) Find the average number of hours worked by the helpers.

    Guuys I just started, so Iím really confused, so any help would be greatly appreciated, thankyou so much for replying

  6. #6
    Join Date
    Jul 2005
    Location
    SW MO, USA
    Posts
    299
    Ok, so now you've typed in the whole assignment. But you haven't written any code yet to attempt the solution. You need to break the problem down into small steps and solve them one by one.
    What have you written to date? Post it with specific questions about how to do each thing it needs to do. You learn a lot by doing. Try different things,

    Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center