Results 1 to 2 of 2

Thread: methods

  1. #1
    shandyding is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default methods

    can anyone help with code for this, totally confused.


    This interface
    should specify the following methods.
    togglePower() – a public method that takes no argument and returns no result.
    Its purpose is to switch the receiver 'on' (true) if it is currently 'off' (false) and if
    the energy level of the receiver is greater than 0, and switch the receiver 'off'
    (false) if it is currently 'on' (true).
    chargeFor() – a public method that takes a single argument of type int called
    numberMinutes and returns a value of type int as result. A charging operation
    for the amount of time specified by the argument is attempted. The energy level of
    the receiver is returned as the result.
    cleanTo() – a public method that takes an int argument called aPosition and
    returns a value of type boolean as result. A cleaning operation starting at the
    current position of the receiver and finishing at the position given by the argument is
    attempted. The method returns true if the receiver is able to complete the cleaning
    operation, and false otherwise.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. Java Noob, trying to call methods from another methods
    By gabrielpr12 in forum New To Java
    Replies: 8
    Last Post: 11-17-2011, 09:07 PM
  3. Replies: 1
    Last Post: 10-23-2011, 12:37 PM
  4. Replies: 1
    Last Post: 10-05-2011, 12:15 AM
  5. Replies: 4
    Last Post: 04-03-2009, 06:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •