Assignemnt #47
Code
/// Name: Sam Menar
/// Period: 6
/// Program Name: Two More Questions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 11/13/2015
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main( String[] args )
{
String a1, a2, conclusion;
conclusion = "";
Scanner keyboard = new Scanner(System.in);
System.out.println( "TWO MORE QUESTIONS, BABY!" );
System.out.println( " " );
System.out.println( "Think of something and I'll try to guess it!" );
System.out.println( " " );
System.out.println( "Question 1) Does it stay inside or outside or both? " );
a1 = keyboard.next();
System.out.println( "Question 2) Is it a living thing? " );
a2 = keyboard.next();
System.out.println( " " );
if ( a1.equals("inside") && a2.equals("yes"))
{
conclusion = "houseplant";
}
if ( a1.equals("inside") && a2.equals("no"))
{
conclusion = "shower curtain";
}
if ( a1.equals("outside") && a2.equals("yes"))
{
conclusion = "bison";
}
if ( a1.equals("outside") && a2.equals("no"))
{
conclusion = "billboard";
}
if (a1.equals("both") && a2.equals("yes"))
{
conclusion = "dog";
}
if (a1.equals("both") && a2.equals("no"))
{
conclusion = "cell phone";
}
System.out.println( "Then what else could you be thinking of besides a " + conclusion + "?!?");
}
}
Picture of the output