Guest User

Untitled

a guest
Jan 25th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class CMDInfoStoring {
  4.  
  5. public static void main (String[] args) {
  6.  
  7. System.out.println("Welcome to my Name/Password Testing Center! Please answer the following questions!");
  8. System.out.println(" Please answer the following questions!");
  9. System.out.print("Enter your name: ");
  10.  
  11.  
  12.  
  13. BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  14.  
  15. String userName = null;
  16. String Password = null;
  17. String ConfirmInfo = null;
  18. boolean Question1 = false;
  19. boolean Question2 = false;
  20.  
  21.  
  22. try {
  23. userName = br.readLine();
  24. } catch (IOException ioe) {
  25. System.out.println("Error trying to Read your name! IO Error!");
  26. System.exit(1);
  27. }
  28.  
  29. System.out.println("Thanks for the name, " + userName);
  30. Question1 = true;
  31. if(Question1 && !Question2);
  32. System.out.println("Question 1 Complete! 1/2 Questions Complete!");
  33. System.out.println();
  34.  
  35. System.out.println("What would you set as your password if it were required?");
  36.  
  37.  
  38.  
  39.  
  40.  
  41. try {
  42. Password = br.readLine();
  43. } catch (IOException ioe) {
  44. System.out.println("Error trying to Read your Password!");
  45. System.exit(1);
  46. }
  47. System.out.println("So your Password would be, " + Password);
  48. Question2 = true;
  49. if(Question2 && Question1);
  50. System.out.println("Question 2 Complete! 2/2 questions Complete!");
  51. System.out.println();
  52. System.out.println("So do you confirm this Info? Yes/No only!");
  53.  
  54.  
  55. try {
  56. ConfirmInfo = br.readLine();
  57. } catch (IOException ioe) {
  58. System.out.println("Yes/no Answers Only!!");
  59. System.exit(1);
  60. }
  61. if(ConfirmInfo.equalsIgnoreCase("no")); {
  62. System.exit(1);
  63. System.out.println();
  64. }
  65. if(ConfirmInfo.equalsIgnoreCase("Yes")); {
  66. System.out.println("Ah thats great then! Let's Continue!");
  67. }
  68. }
  69. }
Add Comment
Please, Sign In to add comment