Assignemnt #47 Two More Questions
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: Two More Questions
///File Name: TwoMoreQ.java
import java.util.Scanner;
public class TwoMoreQ
{
public static void main( String[] args )
{
Scanner momo= new Scanner(System.in);
String stay, life;
System.out.println( "2 Questions: Think of something and I will try to guess it" );
System.out.println ( " Q1: Does it stay inside or outside or both? " );
stay=momo.next();
System.out.println ( " Q2: Is it alive or dead?" );
life=momo.next();
if ( stay.equals("inside") && life.equals("alive" ))
{
System.out.println( "You thinking of a houseplant" );
}
if ( stay.equals("inside") && life.equals("dead") )
{
System.out.println( "You thinking of a shower curtain?" );
}
if ( stay.equals("outside") && life.equals("alive") )
{
System.out.println( "You thinking of a bison?" );
}
if ( stay.equals("outside") && life.equals("dead") )
{
System.out.println( "You thinking of a billboard?" );
}
if ( stay.equals("both") && life.equals("alive") )
{
System.out.println( "you thinking of a billboard?" );
}
if ( stay.equals("both") && life.equals("dead") )
{
System.out.println( "You thinking of a cellphone?" );
}
}
}
Picture of Output