8/04/2010

BCS2234 4/8/ 2010 Lab

Lab Activities 4 august 2010

Write a Java program to read a password. If the password equals to 1234 then print out “Your password is accepted”. Otherwise print “Your password is Not Accepted”.

Flowchart


Java Program
/**
* @(#)Lab3_1.java
*
* Lab3_1 application
*
* @author
* @version 1.00 2010/8/4
*/
import javax.swing.*;
public class Lab3_1 {

public static void main(String[] args) {

// TODO, add your application code
int password;
String answerString = JOptionPane.showInputDialog ("Please enter your password");
password = Integer.parseInt(answerString);
if(password == 1234)
JOptionPane.showMessageDialog(null,"Your Password is Accepted" );
else
JOptionPane.showMessageDialog(null,"Your Password is NOT Accepted" );
}
}

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...