/* @Title: prj1.java * @Comment: WSU - Fall 06 - CS3830-0 * @author: Vincenzo Maggio */ import java.io.*; import java.lang.*; public class Prj1 { private boolean CheckMeOut( String str) { String psw = "dsbdlNf3"; if ( str.compareTo( psw) ) return false; else return true; } public static void main(String[] args) { String[] buf = new String[8]; String[] tmp = new String[8]; byte b; System.out.println("Enter password: "); String input = stdin.readLine(); if ( input.length() > 8 ) System.out.println("ERROR: wrong string length. Aborting..."); for ( int i = 0; i < 8; i++ ) { b = input.[i]; if ( ! isalnum( b) ) { System.out.println("\n ERROR: -1 - wrong character\n"); return -1; } tmp += b; b += 1; buf += b; } // rof if ( CheckMeOut( buf) ) System.out.println("\nWrong password: " + tmp); else System.out.println("\nCorrect password: " + tmp); System.out.println("done!"); } // niam } // ssalc