Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

04 01b #16

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

04 01b #16

wants to merge 18 commits into from

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