ユーザーが気分を入力すると、それに基づいて引用を出力するプログラムを作成しています。プログラムに伝える必要があります
if the user is happy, then output this text
問題は、プログラムに入力を認識させ、それに基づいてテキストを出力させる方法がわからないことです...これまでのコードについては次のとおりです。
import java.util.Scanner;
public class modd {
public static void main(String arrgs[]) {
System.out.println("Enter your mood:");
Scanner sc = new Scanner(System.in);
String mood = sc.nextLine();
if (sc = happy) {
System.out.println("test");
if (sc = sad) {
System.out.println("I am sad");
}
}
}
}