Assignemnt #44 Two Questions
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: Two Questions
///File Name: TwoQ.java
import java.util.Scanner;
public class TwoQ
{
public static void main( String[] args )
{
Scanner momo= new Scanner(System.in);
String Object, Size;
System.out.println( "2 Questions: Think of an object and I will try to guess it" );
System.out.println ( " Q1: Is It animal, vegitable, or mineral? " );
Object=momo.next();
System.out.println ( " Q2: Is it bigger than a bread box?" );
Size=momo.next();
if ( Object.equals("animal") && Size.equals("yes" ))
{
System.out.println( "You thinking of a moosey?" );
}
if ( Object.equals("animal") && Size.equals("no") )
{
System.out.println( "You thinking of a squirrel?" );
}
if ( Object.equals("vegetable") && Size.equals("yes") )
{
System.out.println( "You thinking of a watermellon?" );
}
if ( Object.equals("vegetable") && Size.equals("no") )
{
System.out.println( "You thinking of a carrot?" );
}
if ( Object.equals("mineral") && Size.equals("yes") )
{
System.out.println( "You thinking of a Camaro?" );
}
if ( Object.equals("mineral") && Size.equals("no") )
{
System.out.println( "You thinking of a paper clip?" );
}
}
}
Picture of Output