Skip to content

Latest commit

 

History

History

Week_8

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

READ ME

Back to Discussion Main Page

Legend

Symbols at the end of links and what they mean (hopefully) in order of importance:

  • ?? - Exam or assignment help
  • ? - Directly related to course content
  • ! - Indirectly related to course content
  • !! - Additional or Fun

Spring 2023

// Your weekly simple chatbot program brought to you by our friend ChatGPT

import java.util.Scanner;

public class Chatbot {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        System.out.println("Hi, I'm a chatbot! What's your name?");
        String name = input.nextLine();

        System.out.println("Nice to meet you, " + name + "!");
        System.out.println("How are you feeling today?");
        String mood = input.nextLine();

        if(mood.equals("good")) {
            System.out.println("That's great to hear!");
        } else if(mood.equals("bad")) {
            System.out.println("I'm sorry to hear that. Is there anything I can do to help?");
        } else {
            System.out.println("I'm not sure what you mean. Can you elaborate?");
            String response = input.nextLine();
            System.out.println("Okay, I understand. Thanks for telling me!");
        }
    }
}

Tue May 23

Thu May 25

Winter 2023

Tue Feb 28

  • HW4 Hints

Thu Mar 2