Assignemnt #30

Code

///Colin Hinton
///5th Period
///Comparing Strings
///ComparingString.java
///9/28/2015

import java.util.Scanner;

class ComparingStrings
{
    public static void main (String [] args)
    {
        Scanner keyboard = new Scanner(System.in);
        
        String word;
        Boolean yep, nope;
        
        System.out.println(" Type the word \"pudding\", please. ");
        word = keyboard.next();
        
        yep = word.equals("pudding");
        nope = ! word.equals("pudding");
        
        System.out.println(" You typed what was requested: " + yep);
        System.out.println(" You ignored the polite instructions: " + nope);
    }
}

    

Picture of the output

Assignment 1