All pastes #817284 Raw Edit

PassOut

public java v1 · immutable
#817284 ·published 2007-12-15 12:12 UTC
rendered paste body
/**************  新版 passOut.java  ***********/public class passOut{		public static void main(String srgs[]) {		CardHandler card = new CardHandler();					System.out.println("Please insert your smart card");		System.out.println();		while (true) {			if (card.openFromPath("G:\\SmartCard.txt")) {								if (card.getMeta("LastAction").equals("Passed-in")) {					if (card.getMeta("LastAction").equals("Student")) {						card.adjustValue(3.0);					}					else {						card.adjustValue(2.0);					}				System.out.printf("Sucsess!!   You can take it out\n");				card.setMeta("LastAction","Passed-out");				}				else {					System.out.printf("You should Passs-in first!!\n");				}								if (!card.close()) {					System.out.printf("Please insert card again!!\n");				}								while (card.isInserted()) {}				System.out.println();				System.out.println("Please insert your smart card");				System.out.println();			}		}	}} //end of passIn