Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class quizproject {
- static int score = 0;
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- String ans;
- String[] questions = {
- "Who is the new crew member in Strawhat Pirates?",
- "Who is the right hand of Luffy?",
- "Who is the 4th Hokage?",
- "Who is the Captain of the Rocks Pirate?",
- "How many is the children of Big mom?"
- };
- String[] answers = {"a", "c", "a", "a", "b"};
- System.out.println(questions[0]);
- System.out.println("\t A.Jinbei");
- System.out.println("\t B.Sabo");
- System.out.println("\t C.Carrot");
- System.out.print("Answer: " );
- ans = input.nextLine();
- if(ans.equalsIgnoreCase(answers[0])){
- addScore();
- }
- System.out.println(questions[1]);
- System.out.println("\t A.Sanji");
- System.out.println("\t B.Usopp");
- System.out.println("\t C.Zoro");
- System.out.print("Answer: " );
- ans = input.nextLine();
- if(ans.equalsIgnoreCase(answers[1])){
- addScore();
- }
- System.out.println(questions[2]);
- System.out.println("\t A.Minato");
- System.out.println("\t B.Tobirama");
- System.out.println("\t C.Sarutobi");
- System.out.print("Answer: " );
- ans = input.nextLine();
- if(ans.equalsIgnoreCase(answers[2])) {
- addScore();
- }
- System.out.println(questions[3]);
- System.out.println("\t A.Rocks D. Xebec");
- System.out.println("\t B.Rocks D. Teach");
- System.out.println("\t C.Rocks D. Monkey");
- System.out.print("Answer: " );
- ans = input.nextLine();
- if(ans.equalsIgnoreCase(answers[3])) {
- addScore();
- }
- System.out.println(questions[4]);
- System.out.println("\t A.76");
- System.out.println("\t B.85");
- System.out.println("\t C.88");
- System.out.print("Answer: " );
- ans = input.nextLine();
- if(ans.equalsIgnoreCase(answers[4])) {
- addScore();
- }
- System.out.println("Score: " + score);
- }
- public static void addScore(){
- score++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement