// CIS 226 Ch 2 Welcome to CIS 226
// Assign2 - Create a program which prompt user to enter first and last name and a welcome message is displayed.
// Riter Heng - 2/16/2012
// for Extra Credit
import javax.swing.JOptionPane;
public class Assign2
{
public static void main(String[] args)
{
//System.out.println("Welcome to CIS 226!");
//System.out.println("..");
//System.out.println(("..\n..");
//System.out.printf("%s\n%s\n", "..", "..");
String firstName = JOptionPane.showInputDialog("Please enter your first name:");
//if (firstName != null) {}
//else {System.exit(0);}
String lastName = JOptionPane.showInputDialog("Please enter your last name:");
if((firstName != null) || (lastName != null))
JOptionPane.showMessageDialog(null, "Hello, " + firstName +" " + lastName + ", " +
"\n Welcome to CIS 226", "Message" , 0);
else {JOptionPane.showMessageDialog(null, "Sorry, you have enter your name to enroll into CIS 226.", "Error", JOptionPane.ERROR_MESSAGE);}
} // end method main
}// end class Assign2