Guest User

Users

a guest
Apr 13th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 3.10 KB | None | 0 0
  1. import java.util.*;
  2. public class Users {
  3. String name;
  4. String contact_no;
  5. String email_address;
  6. public String getName() {
  7.     return name;
  8. }
  9. public void setName(String name) {
  10.     this.name = name;
  11. }
  12. public String getContact_no() {
  13.     return contact_no;
  14. }
  15. public void setContact_no(String contact_no) {
  16.     this.contact_no = contact_no;
  17. }
  18. public String getEmail_address() {
  19.     return email_address;
  20. }
  21. public void setEmail_address(String email_address) {
  22.     this.email_address = email_address;
  23. }
  24. public static boolean authenticate(int userID,String password){
  25.     return true;
  26. }
  27. public static void main(String args[]) {
  28.     while(true) {
  29.     Scanner sc=new Scanner(System.in);
  30.     System.out.println("Enter 1 to login and 2 to continue as unregistered user: ");
  31.     int t=sc.nextInt();
  32.     sc.nextLine();
  33.     if(t==1) {
  34.     System.out.println("Enter user ID : ");
  35.     int userID=sc.nextInt();
  36.     sc.nextLine();
  37.     System.out.println("Enter password: ");
  38.     String password=sc.nextLine();
  39.     boolean result= authenticate(userID,password);
  40.     if(result==true) {
  41.        
  42.         System.out.println("Choose from the following options: ");
  43.         System.out.println("1. Call");
  44.         System.out.println("2. Email");
  45.         System.out.println("3. Live Chat");
  46.         System.out.println("4. Video Call");
  47.         System.out.println("5. Forums");
  48.         System.out.println("6. Feedback");
  49.         System.out.println("7. Documentation");
  50.         System.out.println("8. Report Bug");
  51.         System.out.println("9. Request Technician");
  52.         System.out.println("10. Check Account History");
  53.         int option=sc.nextInt();
  54.         sc.nextLine();
  55.         switch(option) {
  56.         case 1: CallAndEmail ob=new CallAndEmail();
  57.                 ob.call();
  58.                 break;
  59.         case 2: CallAndEmail ob1=new CallAndEmail();
  60.                 ob1.email();
  61.                 break;
  62.        
  63.         case 3: Chat lc=new Chat();
  64.                 lc.liveChat();
  65.                 break;
  66.         case 4: Chat lc1=new Chat();
  67.                 lc1.videoCall();
  68.                 break;
  69.         case 5: Forums f=new Forums();
  70.                 System.out.println("What do you want to do: ");
  71.                 System.out.println("1. Post Query");
  72.                 System.out.println("2. Read Post");
  73.                 System.out.println("3. Answer Query");
  74.                 int te=sc.nextInt();
  75.                 if(te==1) {
  76.                     f.postQuery();
  77.                 }
  78.                 else if(te==2) {
  79.                     f.readForums();
  80.                 }
  81.                 else if(te==3) {
  82.                     f.answerQuery();
  83.                 }
  84.                 else {
  85.                     System.out.println("Wrong input");
  86.                 }
  87.                 break;
  88.         case 6:Feedback fd=new Feedback();
  89.                 String feedback;
  90.                 System.out.println("Enter your feedback: ");
  91.                 feedback=sc.nextLine();
  92.                 fd.write(feedback);
  93.                 break;
  94.         case 7: Documentation doc=new Documentation();
  95.                 break;
  96.         case 8: ReportBug rb=new ReportBug();
  97.                 rb.reportBug();
  98.         case 9: break;
  99.         case 10: break;
  100.         }
  101.        
  102.     }
  103.     else {
  104.         System.out.println("Press 1 to try again and 2 to exit");
  105.         int test=sc.nextInt();
  106.         if(test==2) {
  107.             break;
  108.         }
  109.         else {
  110.             continue;
  111.         }
  112.     }
  113.     }
  114.     else {
  115.         System.out.println("Choose from the following options: ");
  116.         System.out.println("1. Call");
  117.         System.out.println("2. Email");
  118.         System.out.println("3. Forums");
  119.         System.out.println("4. Feedback");
  120.         System.out.println("5. Documentation");
  121.        
  122.     }
  123.     }
  124.     System.out.println("Thank you for using our portal");
  125. }
  126. }
Add Comment
Please, Sign In to add comment