Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise Java : LOOP: while() #3

Open
AnnettLaube opened this issue Sep 22, 2017 · 0 comments
Open

Exercise Java : LOOP: while() #3

AnnettLaube opened this issue Sep 22, 2017 · 0 comments

Comments

@AnnettLaube
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant