Assignemnt #47 and Two More Questions
Code
/// Name: Kyle Ivy
/// Period: 5
/// Program Name: TwoQuestion
/// File Name: TwoQuestion.java
/// Date Finished: 12/2/2015
import java.util.Scanner;
public class TwoQuestion
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String firstAnswer, secondAnswer, Answer;
System.out.println( "TWO MORE QUESTIONS, BABY! \n " );
System.out.println( "Think of something and I'll try to guess it! \n " );
System.out.print( "Question 1) Does it stay inside or outside or both? " );
firstAnswer = keyboard.next();
System.out.print( "Question 2) Is it a living thing? " );
secondAnswer = keyboard.next();
if ( firstAnswer.equals( "inside" ) && secondAnswer.equals( "yes" ) )
{
System.out.println( "Then what else could you be thinking of besides a houseplant" );
}
if ( firstAnswer.equals( "inside" ) && secondAnswer.equals( "no" ) )
{
System.out.println( "Then what else could you be thinking of besides a shower curtain" );
}
if ( firstAnswer.equals( "outside" ) && secondAnswer.equals( "yes" ) )
{
System.out.println( "Then what else could you be thinking of besides a bison" );
}
if ( firstAnswer.equals( "outside" ) && secondAnswer.equals( "no" ) )
{
System.out.println( "Then what else could you be thinking of besides a billboard" );
}
if ( firstAnswer.equals( "both" ) && secondAnswer.equals ( "yes" ) )
{
System.out.println( "Then what else could you be thinking of besides a dog" );
}
if ( firstAnswer.equals( "both" ) && secondAnswer.equals ( "no" ) )
{
System.out.println( "Then what else could you be thinking of besides a cell phone" );
}
}
}
prog47.PNG