Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



I get "Bot Conversation Do While loop error" message in my project

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-01-2010
Member
 
Join Date: Aug 2009
Posts: 57
I get "Bot Conversation Do While loop error" message in my project
  

Hello to all,
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.

Reply With Quote
  #2  
Old 25-01-2010
Member
 
Join Date: Nov 2005
Posts: 1,323
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);
                       
            }
                           
        }
    }



}
Reply With Quote
  #3  
Old 25-01-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
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.
Reply With Quote
  #4  
Old 25-01-2010
Member
 
Join Date: May 2008
Posts: 2,384
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
Reply With Quote
  #5  
Old 25-01-2010
Member
 
Join Date: Jan 2008
Posts: 1,515
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";
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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 09:54 AM
"this is not a windows movie maker project file" error message in windows vista Abjawadi Windows Software 5 29-03-2011 08:54 PM
Print request receives message "The macros in this project are disabled." Eagle340 Windows Software 1 07-05-2010 05:31 AM
Vista error message " The device "USB ADSL2 WAN Adapter" set for PPPoA is not available" Chatwin Operating Systems 4 20-12-2008 02: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 09:47 PM


All times are GMT +5.5. The time now is 04:34 AM.