Assignemnt #47 and Questions.java
Code
/// Name: Boris Kazantsev
/// Period: 6
/// Program Name: Questions
/// File Name: Questions.java
/// Date Finished: 1/6/2016
import java.util.Scanner;
public class Questions{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
String Q1, Q2, inside = "inside", outside = "outside", both = "both", alive = "yes", dead = "no";
int R1=0, R2=0;
System.out.println("TWO MORE QUESTIONS!!!!!!!!!");
System.out.println();
System.out.println("Think of something and I'll try to guess it!");
System.out.println();
System.out.print("Does it stay inside or outside or both?");
System.out.print("> ");
Q1 = keyboard.next();
System.out.println();
if (Q1.equals(inside)){
R1 += 1;
}
else if (Q1.equals(outside)){
R1 += 2;
}
else if (Q1.equals(both)){
R1 += 3;
}
System.out.print("Is it a living thing?");
System.out.print("> ");
Q2 = keyboard.next();
System.out.println();
if (Q2.equals(alive)){
R2 += 1;
}
else if (Q2.equals(dead)){
R2 += 2;
}
if (R1 == 1 && R2 == 1){
System.out.println("It is a houseplant!!!!!!!!!!!!!");
}
else if (R1 == 1 && R2 == 2){
System.out.println("It is a curtain!!!!!!!!!");
}
else if (R1 == 2 && R2 == 1){
System.out.println("It is a bison!!!!!!!");
}
else if (R1 == 2 && R2 == 2){
System.out.println("It is a billboard!!!!");
}
else if (R1 == 3 && R2 == 1){
System.out.println("It is a dog!!!!!");
}
else if (R1 == 3 && R2 == 2){
System.out.println("It is a cell phone!!!");
}
}
}
Picture of the output