Assignemnt #47 and Two More Questions
Code
///Name: Dakota Donahue
///Period: 5
///Project Name: Two More Questions
///File Name: TwoMoreQuestions
///Date: 11/5/2015
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String type, size;
System.out.println( " Two Questions! " );
System.out.println( " Think of an object, and I'll try to guess it.\n ");
System.out.println( " Question 1) Is it an animal, vegetable or mineral? " );
type = keyboard.next();
System.out.println( " Question 2) Is it bigger than a breadbox? ( yes or no ) " );
size = keyboard.next();
if ( type.equals("animal") && size.equals("yes") )
{
System.out.println( "You are thinking of a moose." );
System.out.println( " I would ask you if I'm right, but I don't actually care. " );
}
if ( type.equals("animal") && size.equals("no") )
{
System.out.println( "You are thinking of a squirrel. " );
System.out.println( " I would ask you if I'm right, but I don't actually care. " );
}
if ( type.equals("vegetable") && size.equals("yes") )
{
System.out.println( " You are thinking of a watermelon. " );
System.out.println( " I would ask you if I'm right, but I don't actually care. " );
}
if ( type.equals("vegetable") && size.equals("no") )
{
System.out.println( " You are thinking of a carrot. " );
System.out.println( " I would ask you if I'm right, but I don't actually care. " );
}
if ( type.equals("mineral") && size.equals("yes") )
{
System.out.println( " You are thinking of a camaro. " );
System.out.println( " I would ask you if I'm right, but I don't actually care. " );
}
if ( type.equals("mineral") && size.equals("no") )
{
System.out.println( " You are thinking of a paperclip. ");
System.out.println( " I would ask you if I'm right, but I don't actually care. " );
}
}
}