Two More Questions
Code
/// Name: Rachel Smith
/// Period: 5
/// Program Name: Two More Questions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 11/3/2015
import java.util.Scanner;
public class TwoMoreQuestions {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
String q1, q2;
System.out.println( "TWO MORE QUESTIONS, BABY!" );
System.out.println();
System.out.println( "Think of something and I'll try to guess it!" );
System.out.println();
System.out.println( "Question 1) Does it ever wind up inside your body? " );
q1 = keyboard.next();
System.out.println( "Question 2) Is it cheap? " );
q2 = keyboard.next();
System.out.println();
if ( q1.equals("yes") && q2.equals("yes") ) {
System.out.println( "Obviously the cheap thing inside your body is a BigMac." );
}
if ( q1.equals("yes") && q2.equals("no") ) {
System.out.println( "Obviously the expensive thing inside your body is caviar." );
}
if ( q1.equals("no") && q2.equals("yes") ) {
System.out.println( "Obviously the cheap thing not in your body is a paperclip." );
}
if ( q1.equals("no") && q2.equals("no") ) {
System.out.println( "Obviously the expensive thing not in your body is a refrigerator." );
}
}
}
Picture of the output