Assignment #47
Code
/// Name: Jonathan Stine
/// Period: 5
/// Program Name: Two More Questions
/// File Name: TwoMoreQuestions.java
/// Date Finished: 1/19/16
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( "Dos preguntas mas, Por favor" );
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 fit in my garage? " );
q1 = keyboard.next();
System.out.println( "Question 2) Is it inexpensive? " );
q2 = keyboard.next();
System.out.println();
if ( q1.equals("yes") && q2.equals("yes") ) {
System.out.println( "It must be a Toyota Camry!" );
}
if ( q1.equals("yes") && q2.equals("no") ) {
System.out.println( "It's a Lamborghini Hurracan" );
}
if ( q1.equals("no") && q2.equals("yes") ) {
System.out.println( "It's a pile of Garbage!" );
}
if ( q1.equals("no") && q2.equals("no") ) {
System.out.println( "Must be the empire state building!" );
}
}
}
Code Output