Results 1 to 12 of 12

Thread: Java methods

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Time Lord Member The_Doctor's Avatar
    Join Date
    Oct 2004
    Location
    The TARDIS
    Posts
    2,040

    Default Java methods

    This is my first ever method, is it alright?

    //Area of Squares
    public double Area_of_Squares(double Square_Side_Length, int Further_Number_of_Squares, int Square_Size_Increment, double Square_Area, int Counter)
    {
    System.out.println("Enter square side length");
    Square_Side_Length = data_input.nextDouble();
    System.out.println("Enter further number of squares to be calculated");
    Further_Number_of_Squares = data_input.nextInt();
    System.out.println("Enter size increment");
    Square_Size_Increment = data_input.nextInt();

    for(Counter=1; Counter==Further_Number_of_Squares; Counter++)
    {
    Square_Area = Square_Side_Length*Square_Side_Length;
    System.out.printf("Area of Square is f%" , Square_Area);
    Square_Side_Length = Square_Side_Length + Square_Size_Increment;
    }
    return 1;
    }

    Also, how do I call this method.
    Last edited by The_Doctor; 03-14-2007 at 17:27.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO