Assignemnt #30 - Comparing
Code
/// Name: Caelan Dorstad
/// Period: 6
/// Program Name: Comparing
/// File Name: Comparing.java
/// Date Finished: 10/23/2015
import java.util.Scanner;
public class Comparing{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
String word;
boolean ye, nah;
System.out.println("Type \"yo\"");
word = keyboard.next();
ye = word.equals("yo");
nah = !word.equals("yo");
System.out.println("You typed what was requested: " + ye);
System.out.println("You are rude: " + nah);
}
}
Picture of the output