Assignemnt #40
Code
/// Name: Sam Wilson
/// Period: 6
/// Program Name: morequestions
/// File Name: morequestions.java
/// Date Finished: 10/18/2015
import java.util.Scanner;
public class morequestions
{
public static void main( String [] args )
{
Scanner keyboard = new Scanner(System.in);
String q1, q2;
System.out.println( "TWO MORE QUESTIONS, SUCKA!" );
System.out.println();
System.out.println( "Think of something and I'll try to guess it!" );
System.out.println();
System.out.print( "(Question 1) Does it stay inside or outside or both? " );
q1 = keyboard.next();
System.out.print( "(Question 2) Is it a living thing? " );
q2 = keyboard.next();
if (q1 == ("inside") && (q2 == ("yes")))
{
System.out.println( "Then what else could you be thinking of besides a houseplant?!?" );
}
if (q1 == ("inside") && (q2 == ("no")))
{
System.out.println( "Then what else could you be thinking of besides your gaming PC?" );
}
if (q1 == ("outside") && (q2 == ("yes")))
{
System.out.println( "Then what else could you be thinking of besides a bison?!?" );
}
if (q1 == ("outside") && (q2 == (" no")))
{
System.out.println( "Then what else could you be thinking of besides a billboard?!?" );
}
if (q1 == ("both") && (q2 == ("yes")))
{
System.out.println( "Then what else could you be thinking of besides a dog?!?" );
}
if (q1 == ("both") && (q2 == ("no")))
{
System.out.println( "Then what else could you be thinking of besides a cell phone?!?" );
}
}
}
Picture of the output