Skip to content

Commit

Permalink
done a challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
SadineniAbhi committed Sep 27, 2023
1 parent 9b33009 commit 4f41af3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
32 changes: 32 additions & 0 deletions ChatBot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import java.util.Scanner;
public class ChatBot {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("Hello. What is your name?");
//Pick up user's name and store it.
String userName = scan.nextLine();

//add new a line before asking next question.
System.out.println("Hi "+userName+" ! I'm Javabot. Where are you from?");
//Pick up user's home and store it.
String address = scan.nextLine();


//add new a line before asking next question.
System.out.println("I hear it's beautiful at "+address+" ! I'm from a place called Oracle");
System.out.println("How old are you?");
//Pick up age and store it.
int age = scan.nextInt();

//add new a line before asking next question.
System.out.println("So you're " +age+" , cool! I'm 400 years old.");
System.out.println("This means I'm "+400/age+" times older than you.");
System.out.println("Enough about me. What's your favourite language? (just don't say Python)");
//Pick up language and store it.
scan.nextLine();
String language = scan.nextLine();

//add new a line here.
System.out.println(language+", that's great! Nice chatting with you "+userName+". I have to log off now. See ya!");
}
}
1 change: 0 additions & 1 deletion UdemyChallenge3.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
public class UdemyChallenge3 {
public static void main(String[] args){
double p = 0;
int oneApplePrice = 1;
int numOfCustomers = 0;
int numOfApples = 500;
Expand Down
2 changes: 1 addition & 1 deletion UdemyTask3.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ public class UdemyTask3 {
public static void main(String[] args){

Scanner scan = new Scanner(System.in);
System.out.println("Enter Your deteails");
System.out.println("Enter Your details");

String firstName = scan.nextLine();
String lastName = scan.nextLine();
Expand Down

0 comments on commit 4f41af3

Please sign in to comment.