Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5 points Status: Not Submitted E In this exercise, you are going to make a sample bot conversation. At this point, we don't have too

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
5 points Status: Not Submitted E In this exercise, you are going to make a sample bot conversation. At this point, we don't have too much that we can do, but you are going to ask the user for their name and then use that in the constructor for the bot After that, you are going to simulate a conversation. You will print questions to the console and answer them by calling methods from the Bot class. (You don't actually prompt the user for any information other then their name). When you are finished, your output should match the output below (with the exception of your name) Sample Output I Hello. What is your name? Kiara Hello Kiara! My name is Hal! How are you today! You can ask me about the weather, or how many feet are in a mile. I can even convert feet to meters! What's the weather like? Its always warm and dry inside your computer When you are finished, your output should match the output below (with the exception of your name). Sample Output Hello. What is your name? Kiara Hello Kiara! My name is Hal! How are you today! You can ask me about the weather, or how many feet are in a mile. I can even convert feet to meters! What's the weather like? Its always warm and dry inside your computer! How many feet in a mile? There are 5280 feet in a mile. It was nice talking with you! Have a great day! I Challenge: The bot does have some aciditional commands included, but we haven't covered these topics yet. Can you figure out how to access some of these methods? 2.4.7: Chat Bot Savo Submit + Cor name= 11 1 - public class Bot 2 3 private string name; 4 5 - public Bot (String yourName) { 6 yourName; 7 } 8 public void greeting 10 System.out.print("Hello "); System.out.print(name); 12 System.out.println("! My name is Hal!"); 13 System.out.println("How are you today!"); 14 } 15 1 16 - public void help 17 System.out.println("You can ask me about the weather, "); 18 System.out.println("or how many feet are in a mile."); 19 System.out.println("I can even convert feet to meters!"); 20 3 21 22 - public void weather System.out.println("Its always warm and dry inside your computer!"); 24 } 25 public void feetInMile() { 27 System.out.println("There are 5289 feet in a mile."); 28 29 30- public void goodbye 31 System.out.println("It was nice talking with you!"); 32 System.out.println("Have a great day!"); 3 23 26 33 34 35 public void favoriteHumber(int your'lumber) u uoy } public void help() { System.out.println("You can ask me about the weather,"); System.out.println("or how many feet are in a mile."); System.out.println("I can even convert feet to meters!"); } 14 15 16 - 17 18 19 20 21 22 - 23 24 25 26 27 28 29 public void weather() { System.out.println("Its always warm and dry inside your computer!"); } public void feet InMile() { System.out.println("There are 5280 feet in a mile."); } I 31 32 33 34 35 36 37 38 39 40 41 -42 43 44 45 46 public void goodbye() { System.out.println("It was nice talking with you!"); System.out.println("Have a great day!"); } public void favoriteNumber(int yourNumber) { System.out.println("My favorite number is 8."); System.out.print("That is "); System.out.print (your Number 8); System.out.println(" away from your number"); 3 public double feetToMeters(double feet){ double meters feet 0.3048; return meters; 3 2.4.7: Chat Bot 1 limport java.util.Scanner 2 3 public class Bottester 4 { 5 - public static void main(String[] args) { 6 7 1/Put your code here 8 } 10 } 11

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

=+90 percent of all oil refineries) into several smaller companies

Answered: 1 week ago