Skip to content

Exercise Java : LOOP: while()  #3

@AnnettLaube

Description

@AnnettLaube

English description errorneous: summar? -> sum up

Correction for german description:
Summieren Sie "number" in einer while()-Schleife, bis die Summe gleichgross wie oder grösser als "loopLength" ist. Retournieren Sie die Anzahl gebrauchter Schleifendurchgänge.

Please start method name in Template with lowercase: LoopCounter(..) -> loopCounter(...)

Example solution and testcases are not compliant with the description. Example
loopCounter(5,100) -> 5 . 5*5 = 25 and not >100...

Correct example solution: loopCounter(5,100) -> 19
public static int LoopCounter(int number, int loopLength) {
int c = 0;
int result = number;
while (result < loopLength) {
result += number;
c++;
}
return c;
}

Either adapt the description to the example solution/test cases or vice versa.

Kind regards,
Annett

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions