Results 1 to 4 of 4
  1. #1
    constden is offline Member
    Join Date
    Apr 2009
    Posts
    18
    Rep Power
    0

    Default Print routine definition

    I'm working on a simple program for class.
    We have just learned about methods and one of the instructions for my program is to write a print routine method, but I have no idea about what that is supposed to mean.
    For the program we have to write a series of six methods that compute the volumes and surface areas for different objects and then print them out.
    What should the print routine method do? Should it be a method that I need to call every time I need to print a value?
    Last edited by constden; 11-14-2011 at 04:52 PM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,312
    Blog Entries
    7
    Rep Power
    24

    Default Re: Print routine definition

    Quote Originally Posted by constden View Post
    What does a print routine method do?
    Just a wild guess: print something?

    You have to supply more details or ask your professor first.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  3. #3
    constden is offline Member
    Join Date
    Apr 2009
    Posts
    18
    Rep Power
    0

    Default Re: Print routine definition

    I've edited my post and added a little more details. I assumed it would have to print something, I just want to know what.
    Sorry for my ignorance, that is all the specification we were given, so I figured "print routine" was common Java jargon and was wondering what it meant.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,312
    Blog Entries
    7
    Rep Power
    24

    Default Re: Print routine definition

    Quote Originally Posted by constden View Post
    I've edited my post and added a little more details. I assumed it would have to print something, I just want to know what.
    Sorry for my ignorance, that is all the specification we were given, so I figured "print routine" was common Java jargon and was wondering what it meant.
    Maybe they want something like this:

    Java Code:
    public interface SolidObject {
       double getSurface();
       double getVolume();
    }
    All classes that implement the interface above can calculate their surface area and volume. A print routine might look like this:

    Java Code:
    public void print(SolidObject object) {
       System.out.println("surface: "+object.getSurface());
       System.out.println("volume: "+object.getVolume());
    }
    The print( ... ) method takes any SolidObject object and prints its surface and volume.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Hashcode definition question!!
    By chathura87 in forum New To Java
    Replies: 8
    Last Post: 03-03-2011, 04:28 PM
  2. Using 2 Classes= Controller x Definition
    By Bascotie in forum New To Java
    Replies: 35
    Last Post: 05-13-2008, 11:05 PM
  3. Subclass definition
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-23-2008, 08:03 PM
  4. calling a C routine from JAVA running in AIX
    By jcosta in forum New To Java
    Replies: 1
    Last Post: 01-13-2008, 08:05 PM
  5. Eclipse - jumping to method definition
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-07-2007, 03:52 PM

Posting Permissions

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