h1

Java Friday

March 30, 2007

import javax.swing.*;
import java.util.*;
import java.text.*;

public class WeeklyMoodSwing
{

public static void main(String[] args)
{

String dayInput = JOptionPane.showInputDialog(“What day is it?”);

if (dayInput.equalsIgnoreCase(“friday”))
JOptionPane.showMessageDialog(null, “W00t! Friday!” );

else
JOptionPane.showMessageDialog(null, “Sucks to be us.” );

}

}

Advertisements

No comments yet

  1. import javax.swing.JOptionPane;

    public class WeeklyMoodSwing {
    private final static String DAY_QUERY = “What day is it”;
    private final static String FRI_RESULT = “Woot! Friday!”;
    private final static String NOT_FRI_RESULT = “Sucks to be us!”;
    private final static String FRIDAY = “friday”;

    public static void main(String[] args) {

    String dayInput = JOptionPane.showInputDialog(DAY_QUERY);
    String output = NOT_FRI_RESULT;

    if (FRI_RESULT.equalsIgnoreCase(dayInput) {
    output = FRI_RESULT;
    }

    JOptionPane.showMessageDialog(null, output );

    }



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: