Assignment #47 and Two More Questions
Code
///Name: Tim Gibson
///Period: 6
///Project Name: Two More Questions
///File Name: TwoMoreQuestions.java
///Date Finished: 10/8/15
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main ( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String q1, q2;
System.out.print( "TWO MORE QUESTIONS, BABY!\n\nThink of something and I'll try to guess it!\n\nQuestion 1) Does it stay inside or outside or both? " );
q1 = keyboard.next();
System.out.print( "Question 2) Is it a living thing? " );
q2 = keyboard.next();
System.out.println();
if ( q1.equals("inside") && q2.equals("yes"))
{
System.out.println( "Clearly, you're thinking of a beta fish." );
}
if ( q1.equals("outside") && q2.equals("yes"))
{
System.out.println( "Why, you must be thinking of a Water Buffalo!" );
}
if ( q1.equals("both") && q2.equals("yes"))
{
System.out.println( "You're thinking of yourself!" );
}
if ( q1.equals("inside") && q2.equals("no"))
{
System.out.println( "You are thinking of a television!" );
}
if ( q1.equals("outside") && q2.equals("no"))
{
System.out.println( "Clearly, you're thinking of a car!" );
}
if ( q1.equals("both") && q2.equals("no"))
{
System.out.println( "You are obvious;ly thinking of a pair of shoes!" );
}
}
}
Picture of the output