Assignment 30, Comparing Strings
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Weasel or not
///File Name: ComparingStrings.java
///Date Finshed: 10/20/15
import java.util.Scanner;
public class ComparingStrings
{
public static void main(String[] args)
{
Scanner siri =new Scanner(System.in);
String word;
boolean yes, no;
System.out.println("Type the word \"damn\" ya dummy");
word = siri.next();
yes = word.equals("damn");
no = !word.equals("damn");
System.out.println(" You typed waht I asked and swore like the bad person you are " + yes );
System.out.println(" You ignored me like the little brat you are " + no);
}
}
Picture of the output