Assignemnt #47: Two More Questions again
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: Two More Questions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 10/27/2015
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String Response1, Response2, a, b, c;
/// possible solutions domesticated rat, racoon, cat, PC, Car, shoes;
a = "null1";
b = "null2";
c = "null3";
System.out.println( "Two More Questions, homeboi " );
System.out.println( "Think of something and I'll try to guess it! " );
System.out.println( "Question 1| Does it stay inside or outside or both? ");
Response1 = keyboard.next();
if (Response1.equals("outside") )
{
a = "racoon";
b = "car";
}
if (Response1.equals("both") )
{
a = "cat";
b = "shoe";
}
if (Response1.equals("inside") )
{
a = "domesticated rat";
b = "computer";
}
System.out.println( "Question 2| Is it a living thing? " );
Response2 = keyboard.next();
if (Response2.equals("yes") )
{
c = a;
}
if (Response2.equals("no") )
{
c = b;
}
System.out.println( "You must be thinking of a " + c + ".");
}
}
Picture of the output