| | |
converting python to java
![]() |
•
•
Join Date: Apr 2005
Posts: 8
Reputation:
Solved Threads: 0
this is a part of the program that i am having problems with can someone please help me
while (start)
{
carryOn = true; //=== LOCAL VARIABLE ONLY USED INSIDE MAIN-LOOP
String s;
JOptionPane.showInputDialog(null, "pick a number betweeb 1 and 100");
math.random();
int num = Integer.random(LOWER_EASY, UPPER_EASY);
// print "For testing purposes the num generated is:",num
guess = getGuess(FIRST);
numGuesses = 1; // number of guesses made in this game
numGoes += 1;
}
while (start)
{
carryOn = true; //=== LOCAL VARIABLE ONLY USED INSIDE MAIN-LOOP
String s;
JOptionPane.showInputDialog(null, "pick a number betweeb 1 and 100");
math.random();
int num = Integer.random(LOWER_EASY, UPPER_EASY);
// print "For testing purposes the num generated is:",num
guess = getGuess(FIRST);
numGuesses = 1; // number of guesses made in this game
numGoes += 1;
}
•
•
Join Date: Mar 2004
Posts: 763
Reputation:
Solved Threads: 38
Java Syntax (Toggle Plain Text)
numGuesses = 0 while (start) { boolean carryOn = true; String s; int guess = Integer.parseInt(JOptionPane.showInputDialog(null,"pick a number between 1 and 100")); int num = Random.nextInt(UPPER_EASY-LOWER_EASY)+LOWER_EASY; //range between LOWER_EASY and UPPER_EASY System.out.println("For testing purposes the num generated is: "+num); numGuesses++; }
![]() |
Similar Threads
- help with converting a python programto java in eclipsed IDE (Python)
- convert python to java (Python)
Other Threads in the Java Forum
- Previous Thread: Some help needed with Selection Sort in java, Please!!
- Next Thread: Java email notifier
| Thread Tools | Search this Thread |
6 actuate android api applet application applications array arrays automation balls bank binary bluetooth bold business c++ chat class clear client code codesnippet collections component coordinates database defaultmethod development dice doctype dragging ebook eclipse educational error file formatingtextintooltipjava fractal froglogic game givemetehcodez graphics gui hql html ide ideas image infinite ingres integer intersect invokingapacheantprogrammatically j2me java javaexcel javaprojects jni jpanel jtextarea julia linux list map method methods mobile mysql netbeans openjavafx parameter php problem program programming project recursion repositories scanner scrollbar sell server set sms sort sorting sql sqlserver state storm string sun superclass swing swt threads tree websites windows





