Search:

Type: Posts; User: Stayawake

Search: Search took 0.18 seconds.

  1. Replies
    11
    Views
    340

    Re: Consecutive number addition

    I've coded your problem and I will list the steps I took so you can program it.
    note that type conversions may be needed.

    1. you read the number into a variable
    2a. make a loop
    2b. in the loop...
  2. To read an integer you should use .readInt.....

    To read an integer you should use .readInt.. There are different methods for each datatype..

    For a string = readline
    For a integer = readInt

    And so on..

    Hope this helps
  3. Replies
    11
    Views
    340

    If given a input which contains an upperbound,...

    If given a input which contains an upperbound, you could something along the lines like this:


    Int UpperBound = input
    Int Sum

    For(int i; i < UpperBound; i++){
    Sum += i
    }
  4. Do you have to give your new filter() a value? I...

    Do you have to give your new filter() a value? I mean, how does java know what you want to filter if you just say myfilter..
Results 1 to 4 of 4