Assignment 47
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String answer1, answer2, result;
result = "";
System.out.print("\nTWO MORE QUESTIONS!\n\nThink of an object, and I'll try to guess it.\n\nQuestion 1) Does it stay inside or outside or both? ");
answer1 = keyboard.next();
System.out.print("Question 2) Is it a living thing? ");
answer2 = keyboard.next();
if (answer1.equals("inside") && answer2.equals("yes"))
{
result = "houseplant";
}
if (answer1.equals("inside") && answer2.equals("no"))
{
result = "shower curtain";
}
if (answer1.equals("outside") && answer2.equals("yes"))
{
result = "bison";
}
if (answer1.equals("outside") && answer2.equals("no"))
{
result = "billboard";
}
if (answer1.equals("both") && answer2.equals("yes"))
{
result = "dog";
}
if (answer1.equals("both") && answer2.equals("no"))
{
result = "cell phone";
}
System.out.println("\nYou are thinking of a " +result+ ".\nI would ask you if I\'m right, but I don\'t actually care.");
}
}