Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.95 KB | None | 0 0
  1. //dito pinoprocess ang lahat
  2. import java.util.*; //utilities
  3. public class mainProcess{
  4.     //scanner object
  5.     Scanner sc = new Scanner(System.in);
  6.     String userA = "user0071", userB = "user0069"; //users
  7.     String login, menuSelect, mainReturn, scheduleDaySelect,studentListSelect; //string na para sa functions
  8.     String rating; //string para sa function sa loob ng function
  9.     //login
  10.     public void login() {
  11.         System.out.println("**************************");
  12.         System.out.println("*WELCOM TO FACULTY SYSTEM*");
  13.         System.out.println("**************************");
  14.         System.out.println("");
  15.         int x = 0;
  16.         do{
  17.             System.out.print("*ENTER USER ID:");
  18.             login = sc.nextLine();
  19.            
  20.             if(login.equals(userA)){
  21.                 mainProcess userA = new mainProcess();
  22.                 userA.userA(); 
  23.             }
  24.             else{
  25.                 System.out.println("!Invalid user id!");
  26.                 System.out.println("*****************");
  27.             }
  28.         }while(x <= 0);
  29.     }
  30.     //encasulation
  31.     //connected to sa studGrade
  32.     //userA
  33.     public void userA(){
  34.         System.out.println("*****Welcome Mr. Santiago*****");
  35.                 System.out.println("****************************");
  36.                 System.out.println("*****Menu Selection*****");
  37.                
  38.                 mainProcess menu = new mainProcess();
  39.                 menu.menu();
  40.                 menuSelect = sc.nextLine();
  41.                
  42.                 //encasulation tong part na ito kasi may set and get
  43.                  //connected to sa studGrade if no.1
  44.                 if(menuSelect.equals("1")){
  45.                     System.out.println("*****Student Grade Compute*****");
  46.                     int y = 0;
  47.                     do{
  48.                    
  49.                         System.out.println("Enter Student Name : ");
  50.                             String studName = sc.nextLine();
  51.                             System.out.print("Enter Student Grade: ");
  52.                             double grade = sc.nextDouble();
  53.                             studGrade display = new studGrade();
  54.                             display.setNameA(studName);
  55.                             display.setGradeA(grade);
  56.                             if(grade>=80)
  57.                             {
  58.                                 rating ="A";
  59.                             }
  60.                             else if(grade>=60 && grade<80)
  61.                             {
  62.                                rating ="B";
  63.                             }
  64.                             else if(grade>=40 && grade<60)
  65.                             {
  66.                                 rating ="C";
  67.                             }
  68.                             else
  69.                             {
  70.                                 rating ="D";
  71.                             }  
  72.                             System.out.println("------------------------------------------");
  73.                             System.out.println("NAME--------------GRADE-------------RATING");
  74.                             System.out.print(display.getNameA()+"..........."+display.getGradeA()+"..........."+display.getRatingA());
  75.                             System.out.println();
  76.                            
  77.                             System.out.print("Press any key to return to main menu....");
  78.                             mainReturn = sc.nextLine();
  79.                             if(mainReturn.equals(mainReturn)){
  80.                                 mainProcess returnUserA = new mainProcess();
  81.                                 returnUserA.userA();
  82.                                 System.out.println("");
  83.                                 y++;
  84.                             }      
  85.                     }while(y <= 0);
  86.                 }
  87.                 //poly naman to connected yung studname-studsection-studcourse - polyrun
  88.                 //naka extends yung studSection & studCourse sa studName then tinawag ko sa polyrun para naka compile na sya pag tinawag sa mainProcess
  89.                 else if(menuSelect.equals("2")){
  90.                     System.out.println("*****STUDENT LIST*****");
  91.                     int t = 0;
  92.                     do{
  93.                    
  94.                     System.out.print("type a section:");
  95.                     studentListSelect = sc.nextLine();
  96.                     if(studentListSelect.equalsIgnoreCase("bt301")){
  97.                         polyRun displayInfoStud = new polyRun();
  98.                         displayInfoStud.polyRun();
  99.                        
  100.                         System.out.print("Press any key to return to main menu....");
  101.                             mainReturn = sc.nextLine();
  102.                             if(mainReturn.equals(mainReturn)){
  103.                                 mainProcess returnUserA = new mainProcess();
  104.                                 returnUserA.userA();
  105.                                 System.out.println("");
  106.                                 t++;
  107.                             }
  108.                         }
  109.                     }while(t<=0);
  110.                     //mali pa to
  111.                 }
  112.                    
  113.                 //else if no.3 to abstract
  114.                 else if(menuSelect.equals("3")){
  115.                 System.out.println("*****SCHEDULE VIEWER*****");
  116.                 int z = 0;
  117.                     do{
  118.                         System.out.print("Select day(monday - friday): ");
  119.                         scheduleDaySelect = sc.nextLine();
  120.                         profTime showDay = new profTime();
  121.                         if(scheduleDaySelect.equalsIgnoreCase("monday")){
  122.                             showDay.schedMonday();
  123.                             showDay.monday();
  124.                            
  125.                             break;
  126.                         }else if(scheduleDaySelect.equalsIgnoreCase("tuesday")){
  127.                             showDay.schedTuesday();
  128.                             showDay.monday();
  129.                            
  130.                             break;
  131.                         }else if(scheduleDaySelect.equalsIgnoreCase("wednesday")){
  132.                             showDay.schedWednesday();
  133.                             showDay.wednesday();
  134.                            
  135.                             break;
  136.                         }else if(scheduleDaySelect.equalsIgnoreCase("thursday")){
  137.                             showDay.schedThursday();
  138.                             showDay.thursday();
  139.                            
  140.                             break;
  141.                         }else if(scheduleDaySelect.equalsIgnoreCase("friday")){
  142.                             showDay.schedFriday();
  143.                             showDay.friday();
  144.                            
  145.                             break;
  146.                         }
  147.            
  148.                        
  149.                         System.out.print("Press any key to return to main menu....");
  150.                                 mainReturn = sc.nextLine();
  151.                                 if(mainReturn.equals(mainReturn)){
  152.                                     mainProcess returnUserA = new mainProcess();
  153.                                     returnUserA.userA();
  154.                                     System.out.println("");
  155.                                     z++;
  156.                                 }
  157.                     }while(z <=0);
  158.                        
  159.                 }
  160.                 //inheritance logout
  161.                 else if(menuSelect.equals("4")){
  162.                     logout userOut = new logout();
  163.                     userOut.logout();
  164.                    
  165.                     mainProcess loginUlit = new mainProcess();
  166.                     loginUlit.login();
  167.                 }
  168.     }
  169.     //DITO YUNG ABSTRACT CONNECTED TO SA PROFTIME AT PROFDAY //else if no.3 to
  170.     public void schedule(){
  171.         //abang lang to wala namang nailagay. dito dapat yung abstract
  172.     }
  173.    
  174.     //menulist dito ko nalang nilagay.
  175.     public void menu(){
  176.         System.out.println("(1)COMPUTE GRADES");
  177.         System.out.println("(2)STUDENT LIST");
  178.         System.out.println("(3)SCHEDULE");
  179.         System.out.println("(4)LOGOUT");
  180.     }
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement