Hallooo!
Ich hab heute um 24:00 eine Übung in Java abzugeben und ehrlich gesagt gar keinen Plan davon. ???:L Ihr seid sozusagen meine letzte Hoffnung für heute, ansonsten kassier ich wieder 0 Punkte... Was ich natürlich auch überleben würde! :wink:
Also falls jemand wirklich absolut zuviel Zeit hat, dann wär ich demjenigen natürlich sehr, sehr dankbar, wenn er/sie mir das Programm schreiben könnte... :roll:
Die Angabe lautet (leider auf Englisch, ich weiß *heul*):
Write a class GuessingGame, that lets the user guess a natural number. Let this number be a random number (in a certain range), the program ‘thinks of’. Let the user enter her guesses and the program tell her if the guess is too low or too high.
Write a class GuessingGameTest to test the Class GuessingGame.
Hints, tips, and comments:
Write the tester class first and run it
Then start working on the GuessingGame and TEST it as you go along
Have you class be able to guess without user input: smth like: .guess(6)
Implement a method that asks the user for a number and then calls .guess.
This will make it easier for you to test (less user input)
So sollte das Output im Tester dann aussehen:
Starting a new Game
You guessed: 19
and that was too high!
You guessed: 18
and that was too high!
You guessed: 17
and that was too high!
You guessed: 16
and that was too high!
You guessed: 15
and that was too high!
You guessed: 14
and that was too high!
You guessed: 13
and that was too high!
You guessed: 12
and that was too high!
You guessed: 11
and that was too high!
You guessed: 10
and that was too high!
You guessed: 9
and that was too high!
You guessed: 8
and that was right!
(took you 12 guesses)
right guess was: 8
Starting a new Game
You guessed: 32
and that was too low!
You give up?
correct answer would have been: 39
Also ich sag schon mal hier danke, dass ihr euch überhaupt die Zeit genommen habt, das hier alles zu lesen! :###
Liebe Grüße,
Turbokueken
Ich hab heute um 24:00 eine Übung in Java abzugeben und ehrlich gesagt gar keinen Plan davon. ???:L Ihr seid sozusagen meine letzte Hoffnung für heute, ansonsten kassier ich wieder 0 Punkte... Was ich natürlich auch überleben würde! :wink:
Also falls jemand wirklich absolut zuviel Zeit hat, dann wär ich demjenigen natürlich sehr, sehr dankbar, wenn er/sie mir das Programm schreiben könnte... :roll:
Die Angabe lautet (leider auf Englisch, ich weiß *heul*):
Write a class GuessingGame, that lets the user guess a natural number. Let this number be a random number (in a certain range), the program ‘thinks of’. Let the user enter her guesses and the program tell her if the guess is too low or too high.
Write a class GuessingGameTest to test the Class GuessingGame.
Hints, tips, and comments:
Write the tester class first and run it
Then start working on the GuessingGame and TEST it as you go along
Have you class be able to guess without user input: smth like: .guess(6)
Implement a method that asks the user for a number and then calls .guess.
This will make it easier for you to test (less user input)
So sollte das Output im Tester dann aussehen:
Starting a new Game
You guessed: 19
and that was too high!
You guessed: 18
and that was too high!
You guessed: 17
and that was too high!
You guessed: 16
and that was too high!
You guessed: 15
and that was too high!
You guessed: 14
and that was too high!
You guessed: 13
and that was too high!
You guessed: 12
and that was too high!
You guessed: 11
and that was too high!
You guessed: 10
and that was too high!
You guessed: 9
and that was too high!
You guessed: 8
and that was right!
(took you 12 guesses)
right guess was: 8
Starting a new Game
You guessed: 32
and that was too low!
You give up?
correct answer would have been: 39
Also ich sag schon mal hier danke, dass ihr euch überhaupt die Zeit genommen habt, das hier alles zu lesen! :###
Liebe Grüße,
Turbokueken