Show Bid Request
guess my number
Bid Request Id: 529
|
|
|
Description:
using java to create three buttons. they are buttons too high, to low, and that's it. the user picks a number in a range of 1-100 and clicks on it for the computer to guess it.
Deliverables: the program to run.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
|
This bid was accepted by the buyer!
|
$25 (USD)
|
Jun 27, 2001 1:09:56 AM EDT
|
9.97
(Excellent)
|
|
|
Here's the logic
import java.util.*;
public class NumberGuessBean {
int answer;
boolean success;
String hint;
int numGuesses;
public NumberGuessBean() {
reset();
}
public void setGuess(String guess) {
numGuesses++;
int g;
try {
g = Integer.parseInt(guess);
}
catch (NumberFormatException e) {
g = -1;
}
if (g == answer) {
success = true;
}
else if (g == -1) {
hint = 'a number next time';
}
else if (g < answer) {
hint = 'higher';
}
else if (g > answer) {
hint = 'lower';
}
}
public boolean getSuccess() {
return success;
}
public String getHint() {
return '' + hint;
}
public int getNumGuesses() {
return numGuesses;
}
public void reset() {
answer = Math.abs(new Random().nextInt() % 100) + 1;
success = false;
numGuesses = 0;
}
}
Accept my bid if you like this
Jimmy |
|
|
|
|
$25 (USD)
|
Jun 27, 2001 1:23:16 AM EDT
|
9.97
(Excellent)
|
|
|
Accept my Bid and I will tell you how to use it in your own environment.
Jimmy |
|
|
|
|
$25 (USD)
|
Jun 27, 2001 2:15:56 AM EDT
|
9.97
(Excellent)
|
|
|
I have made two versions of this applet for you and one version in JSP. I can send you all the three in 5 minutes after you accept my bid. |
|
|
|
|
|