|
| ||||||||||
| Tags: application, class, java, object, program, swing, timer |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| I get "Bot Conversation Do While loop error" message in my project
I recently started learning java language. I have created one program that randomizes numbers and then draws questions for the user to answer accordingly. When I tried to run that program I get "Bot Conversation Do While loop error." I don't know what is that mean. Can anyone tell me how to fix this problem. Thanks in advanced. |
|
#2
| ||||
| ||||
| Re: I get "Bot Conversation Do While loop error" message in my project
From your information it seems that there is some problem in your code. It seems that you have place wrong value in Do while loop and that's why you are getting such type of problem. In this case try to change other value or try to change integer. I have written following program for you. Just try to understand it. Code: import java.io.*;
public class Conversation2
{
public static void main (String[] args) throws IOException
{
int k = 0;
int Countesr = 0;
String answers = "";
BufferedReader inKbs = new BufferedReader (new InputStreamReader (System.in));
String Q1 = "Dude How old are you?";
String Q2 = "Whats Your Name?";
String Q3 = "In Which school you go?";
String Q4 = "Are you a boy or a girl?";
String Q5 = "can you eat apple?";
String Q6 = "Do you have any bat?";
String Q7 = "What do you do for trust?";
String Q8 = "Where were you born?";
String Q9 = "What state do you love most?";
String Q10 = "Are you a hippie?";
do
{
k = (int) (Math.random () * 11);
System.out.println (k);
switch (k)
{
case 1:
{
System.out.println (Q1);
String Answers = inKbs.readLine ();
Counters++;
}
case 2:
{
System.out.println (Q2);
String Answers = inKb.readLine ();
Counters++;
}
case 3:
{
System.out.println (Q3);
String Answers = inKbs.readLine ();
Counters++;
}
case 4:
{
System.out.println (Q4);
String Answers = inKbs.readLine ();
Counters++;
}
case 5:
{
System.out.println (Q2);
String Answers = inKbs.readLine ();
Counters++;
}
case 6:
{
System.out.println (Q2);
String Answes = inKbs.readLine ();
Counters++;
}
case 7:
{
System.out.println (Q2);
String Answer = inKb.readLine ();
}
case 8:
{
System.out.println (Q2);
String Answser = inKs.readLine ();
Counters++;
}
case 9:
{
System.out.println (Q2);
String Ansswer = insKb.readLine ();
Countesr++;
}
case 10:
{
System.out.println (Q2);
String Answers = inKbs.readLine ();
Counters++;
}
while (Counters>= 11);
}
}
}
} |
|
#3
| ||||
| ||||
| Re: I get "Bot Conversation Do While loop error" message in my project
I think you have used wrong variable in Do While loop and that's why you are getting such type of problem. In this case you have to use another method to do this. I think you have to put all your questions in array and then try to randomly access these using for loop. You can also use String> loaded from a text file to do this.
__________________ Grand Theft Auto 4 PC Video Game |
|
#4
| ||||
| ||||
| Re: I get "Bot Conversation Do While loop error" message in my project
I think you have assign wrong value to integer and that's why you are getting such type of problem. In this case you have to assign proper value to integer to fix this problem. I think you have to assign value to counter less than 12 to get rid out of this problem. Just try to use following code in your program to fix this problem. Code: do{
// write your code here
while (Counters >= 12);
} //end do
__________________ The FIFA Manager 2009 PC Game |
|
#5
| ||||
| ||||
| Re: I get "Bot Conversation Do While loop error" message in my project
Have you save your questions in array? If not then you may likely get such type problem. You have to first save all your question in array and then try to extract all these question one by one using for loop. I have just written following code for storing all questions in array. Just save this code in your project and then try to run it. Code: String[] q = new String[12]; q[0] = "Type q1 here"; q[1] = "Type q2 here"; write q[2] to q[9] q[10] = "Type q11 here"; |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "I get "Bot Conversation Do While loop error" message in my project" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Application Error: The instruction at "0x7c91b21a" referenced memory at "0x00000010". Message on bootup | Jaiya | Operating Systems | 5 | 19-04-2011 08:54 AM |
| "this is not a windows movie maker project file" error message in windows vista | Abjawadi | Windows Software | 5 | 29-03-2011 07:54 PM |
| Print request receives message "The macros in this project are disabled." | Eagle340 | Windows Software | 1 | 07-05-2010 04:31 AM |
| Vista error message " The device "USB ADSL2 WAN Adapter" set for PPPoA is not available" | Chatwin | Operating Systems | 4 | 20-12-2008 01:24 PM |
| Project Web Access via IE7: "Export Grid to Excel" cause VBSCRIPT (error) message: "The activeX control on which this feature depends could not be created" | Theo-Dore | Microsoft Project | 2 | 17-01-2007 08:47 PM |