The Simple Bot "Joudi" is a Java console application designed to interact with users by performing a series of tasks including greeting, name recognition, age guessing, counting, and testing the user's basic programming knowledge.
- Greeting: Joudi introduces itself and requests the user's name.
- Name Reminder: Joudi acknowledges the user's name in a friendly manner.
- Age Guess: Joudi estimates the user's age using remainders provided by the user.
- Counting: Joudi demonstrates its ability to count up to a number specified by the user.
- Knowledge Test: Joudi quizzes the user with a simple programming question.
- Farewell: Joudi ends the interaction with a congratulatory message.
- Java Runtime Environment (JRE) or Java Development Kit (JDK) to run the Java program.
- No external libraries are required.
To use the Simple Bot, follow these steps:
- Ensure Java is installed on your system. You can check by running
java -version
in your command line. - Download the
SimpleBot.java
file to your local system. - Compile the program using
javac IntroductionToJava/SimpleBot.java
from the command line within the directory where the file is located. - Run the compiled program with
java IntroductionToJava.SimpleBot
.
Once the program is running, simply follow the on-screen prompts:
- Enter your name when the bot asks for it.
- Provide the remainders of your age when divided by 3, 5, and 7 to let the bot guess your age.
- Tell the bot how high to count, and it will count out loud for you.
- Answer the programming knowledge question by entering the number corresponding to the correct answer.
- Once you answer the question correctly, the bot will congratulate you and wish you a nice day.
Hello! My name is Joudi.
I was created in 2000.
Please, remind me your name.
> John
What a great name you have, John!
Let me guess your age.
Enter remainders of dividing your age by 3, 5, and 7.
> 1
> 2
> 1
Your age is 22; that's a good time to start programming!
Now I will prove to you that I can count to any number you want.
> 5
0!
1!
2!
3!
4!
5!
Let's test your programming knowledge.
Why do we use methods?
1. To repeat a statement multiple times.
2. To decompose a program into several small subroutines.
3. To determine the execution time of a program.
4. To interrupt the execution of a program.
> 2
Congratulations, have a nice day!
- If the program does not compile, ensure you have the correct Java version installed and that the
javac
command is properly executed. - If the bot does not accept your input, make sure you are entering the expected data type (e.g., integers for age remainders).
The Simple Bot is open-source and free to use. There is no license associated with this sample code.