Assignment 47
Code
/// Name: Josh Bautista
/// Period: 6
/// Program Name: TwoMoreQuestions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 12/10/2015
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main( String[]args )
{
Scanner keyboard = new Scanner (System.in);
String question1, question2;
System.out.println(" Think of something and I'll try to guess it! ");
System.out.print("");
System.out.print("");
System.out.println(" Questions 1) Does it stay inside or outside or both?");
question1 = keyboard.next();
System.out.println(" Questions 2) Is it a living thing?");
question2 = keyboard.next();
if (question1.equals("inside") && question2.equals("yes"))
{
System.out.print("houseplant");
}
if (question1.equals("outside") && question2.equals("yes"))
{
System.out.print(" bison ");
}
if (question1.equals("both") && question2.equals("yes"))
{
System.out.print(" dog ");
}
if (question1.equals("inside") && question2.equals("no"))
{
System.out.print(" shower curtain ");
}
if (question1.equals("outside") && question2.equals("no"))
{
System.out.print(" billboard ");
}
if (question1.equals("both") && question2.equals("no"))
{
System.out.print(" cell phone ");
}
}
}
Picture of Output