Assignemnt #47: Two More Questions
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: TwoMoreQuestions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 11/5/2015
import java.util.Scanner;
public class TwoMoreQuestions
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String one, two;
System.out.println("TWO MORE QUESTIONS BABY!!!!!!!!!");
System.out.println("\nthink of something and I'll try to guess what it is!");
System.out.print("\nQuestion 1.) Does it belong inside or live outside or both? ");
one = keyboard.next();
System.out.print("\nQuestion 2.) Is it alive? ");
two = keyboard.next();
if (one.equals("inside") && two.equals("yes"))
{
System.out.println("\nOh! I know what you are thinking of! It is a houseplant.");
}
if (one.equals("outside") && two.equals("yes"))
{
System.out.println("\nOh! I know what you are thinking of! It is a bison.");
}
if (one.equals("both") && two.equals("yes"))
{
System.out.println("\nOh! I know what you are thinking of! It is a dog.");
}
if (one.equals("inside") && two.equals("no"))
{
System.out.println("\nOh! I know what you are thinking of! It is a shower curtain.");
}
if (one.equals("outside") && two.equals("no"))
{
System.out.println("\nOh! I know what you are thinking of! It is a billboard.");
}
if (one.equals("both") && two.equals("no"))
{
System.out.println("\nOh! I know what you are thinking of! It is a cell phone.");
}
}
}
Picture of the output