Assignment 39, A Little Quiz
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Little Quiz
///File Name: LittleQuiz.java
///Date Finshed: 10/30/15
import java.util.Scanner;
public class LittleQuiz
{
public static void main ( String [] args)
{
Scanner siri = new Scanner(System.in);
String A, B, C;
System.out.println("Here take this quiz!");
System.out.println(" ");
System.out.print("Q1. Does Morgan dress awkwardly? ");
A = siri.next();
if (A.equals("yes"))
{
System.out.println("You are right! Congrats!");
}
else if (A.equals("no"))
{
System.out.println("No, I'm sorry she does dress awkwardly the majority of the time.");
}
System.out.println(" ");
System.out.print("Q2. Is Stella hella cool? ");
B = siri.next();
{
if (B.equals("yes"))
{
System.out.println("You are right! Congrats!");
}
else if (B.equals("no"))
{
System.out.println("I'm sorry are you stupid?");
}
System.out.println(" ");
System.out.print("Q3. Is Morgan cooler than Stella? ");
C = siri.next();
if (C.equals("no"))
{
System.out.println("You are right, Morgan is NOT cooler than Stella!");
}
else if (C.equals("yes"))
{
System.out.println("Morgan is the biggest loser, so she is not, by far, cooler than Stella");
}
System.out.println(" ");
if ( A.equals("yes") && B.equals("yes") && C.equals("no"))
{
System.out.println("You got all the questions right!");
}
else if ( A.equals("yes") && B.equals("no") && C.equals("no"))
{
System.out.println("You got 2 questions right!");
}
else if ( A.equals("yes") && B.equals("yes") && C.equals("yes"))
{
System.out.println("You got 2 questions right!");
}
else if ( A.equals("no") && B.equals("yes") && C.equals("no"))
{
System.out.println("You got 2 questions right!");
}
else if ( A.equals("no") && B.equals("no") && C.equals("no"))
{
System.out.println("You got 1 question right!");
}
else if ( A.equals("yes") && B.equals("no") && C.equals("no"))
{
System.out.println("You got 1 question right!");
}
else if ( A.equals("no") && B.equals("yes") && C.equals("no"))
{
System.out.println("You got 1 question right!");
}
else if ( A.equals("no") && B.equals("no") && C.equals("yes"))
{
System.out.println("You got no questions right are you dumb?");
}
}
}
}
Picture of the output