Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

04 02b#18

Open
Erdenebulgan19 wants to merge 21 commits into
master from
04_02b
Open

04 02b #18
Erdenebulgan19 wants to merge 21 commits into
master from
04_02b

Conversation

@Erdenebulgan19

@Erdenebulgan19 Erdenebulgan19 commented Jul 7, 2020

Copy link
Copy Markdown

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /