Assignment #47 and Two More Questions
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: Two More Questions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 11/06/2015/
import java.util.*;
public class TwoMoreQuestions
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String a1, a2;
System.out.println("Think of something and I'll try to guess it.");
System.out.println("Question 1 - Does it belong inside or outside or both?");
a1 = keyboard.next();
System.out.println("");
System.out.println("Question 2 - Is it alive?");
a2 = keyboard.next();
if (a1.equals("inside") && a2.equals("yes"))
{
System.out.println("You are thinking of a houseplant!");
}
if (a1.equals("inside") && a2.equals("no"))
{
System.out.println("You are thinking of a shower curtain");
}
if (a1.equals("outside") && a2.equals("yes"))
{
System.out.println("You are thinking of a bison");
}
if (a1.equals("outside") && a2.equals("no"))
{
System.out.println("You are thinking of a billboard");
}
if (a1.equals("both") && a2.equals("yes"))
{
System.out.println("You are thinking of a dog");
}
if (a1.equals("both") && a2.equals("no"))
{
System.out.println("You are thinking of a cellphone");
}
/*else
{
System.out.println("ERROR!! NO CAPS & SPELL CORRECTLY. ");
}
*/
}
}
Picture of the output