Skip to content

Conversation

Erdenebulgan19
Copy link

package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
String question = "What is the largest planet in our solar system?";
String choiceOne = "Earth";
String choiceTwo = "Jupiter";
String choiceThree = "Saturn";

    String correctAnswer = choiceThree;
    System.out.println(question);
    System.out.println("Choose one of the following"  + choiceOne + " , " + choiceTwo + ", or " + choiceThree + ",");
    Scanner scanner = new Scanner(System.in);
    String input = scanner.next();
    if (correctAnswer.equals(input.toLowerCase())) {
        System.out.println("Congrats! That's the correct answer");
    } else {
        System.out.println("You are incorect. The correct answer is " + correctAnswer);
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant