Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class CMDInfoStoring {
- public static void main (String[] args) {
- System.out.println("Welcome to my Name/Password Testing Center! Please answer the following questions!");
- System.out.println(" Please answer the following questions!");
- System.out.print("Enter your name: ");
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- String userName = null;
- String Password = null;
- String ConfirmInfo = null;
- boolean Question1 = false;
- boolean Question2 = false;
- try {
- userName = br.readLine();
- } catch (IOException ioe) {
- System.out.println("Error trying to Read your name! IO Error!");
- System.exit(1);
- }
- System.out.println("Thanks for the name, " + userName);
- Question1 = true;
- if(Question1 && !Question2);
- System.out.println("Question 1 Complete! 1/2 Questions Complete!");
- System.out.println();
- System.out.println("What would you set as your password if it were required?");
- try {
- Password = br.readLine();
- } catch (IOException ioe) {
- System.out.println("Error trying to Read your Password!");
- System.exit(1);
- }
- System.out.println("So your Password would be, " + Password);
- Question2 = true;
- if(Question2 && Question1);
- System.out.println("Question 2 Complete! 2/2 questions Complete!");
- System.out.println();
- System.out.println("So do you confirm this Info? Yes/No only!");
- try {
- ConfirmInfo = br.readLine();
- } catch (IOException ioe) {
- System.out.println("Yes/no Answers Only!!");
- System.exit(1);
- }
- if(ConfirmInfo.equalsIgnoreCase("no")); {
- System.exit(1);
- System.out.println();
- }
- if(ConfirmInfo.equalsIgnoreCase("Yes")); {
- System.out.println("Ah thats great then! Let's Continue!");
- }
- }
- }
Add Comment
Please, Sign In to add comment