Results 1 to 2 of 2
  1. #1
    Matthewcr914 is offline Member
    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    0

    Default Ap Comp Science HW Question Methods

    I can't figure this answer out. We just learned methods today and I am a little confused. The question is, Write a method called sum100 that adds up all the integers from 1 to 100 inclusive and returns the answer. If somebody wouldn't mind explaining how to do this that would be great! Thanks

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,789
    Rep Power
    7

    Default Re: Ap Comp Science HW Question Methods

    Post your attempt and ask a specific question. Try writing the method signature. For example the main method is:
    Java Code:
    public static void main(String[] args)
    So for your method you need to think about:
    what access it should have?
    what return type it should have?
    what name it should have?
    what parameters it should have?
    should it be static or non-static?

    If you do not know then review your class notes, textbook or Google it.

Similar Threads

  1. methods question
    By noobie_nate in forum New To Java
    Replies: 2
    Last Post: 08-11-2013, 10:22 PM
  2. client on one comp and server on another comp
    By NadE88 in forum Networking
    Replies: 2
    Last Post: 04-04-2013, 02:14 AM
  3. AP computer science question
    By svo in forum New To Java
    Replies: 9
    Last Post: 04-08-2012, 06:29 PM
  4. Replies: 4
    Last Post: 11-27-2007, 11:59 PM

Tags for this Thread

Posting Permissions

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