Guest User

Final project

a guest
May 15th, 2018
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 40.42 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package project;
  7. import java.util.*;
  8. public class Project {
  9.     public static double p_result;
  10.     public static String name_l[] = new String[100];
  11.     public static String roll_l[] = new String[100];
  12.     public static double quiz_m[] = new double[100];
  13.     public static double assig_m[] = new double[100];
  14.     public static double OHT1_m[] = new double[100];
  15.     public static double OHT2_m[] = new double[100];
  16.     public static double Finals_m[] = new double[100];
  17.    
  18.    
  19.    
  20.     public static void main(String[] args){
  21.         Scanner input = new Scanner(System.in);
  22.         System.out.println("               [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]");
  23.         System.out.println("               [                                                                            ]");            
  24.         System.out.println("               [             ++++++++++STUDENT PORTAL FOR THE CLASS OF 5++++++++++++        ]");
  25.         System.out.println("               [             =======================================================        ]");
  26.         System.out.println("               [                                                                            ]");
  27.         System.out.println("               [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]");
  28.         while (true) {
  29.             System.out.println("Are you the teacher or the student? \nFor Teacher Press 1. For Student press 2.");
  30.             System.out.print("Your choice: ");
  31.             int choice = input.nextInt();
  32.        
  33.     //================================================= FOR ICT SUBJECT =================================================#
  34.             if (choice == 1) {
  35.                 line_break();
  36.                 System.out.println("YOU ARE THE TEACHER! CHOOSE YOUR SUBJECT: ");
  37.                 System.out.println(" For ICT, Choose 1");
  38.                 System.out.println(" For ECA, Choose 2");
  39.                 System.out.println(" For CAL, Choose 3");
  40.                 line_break();
  41.                 System.out.println("Make the choice: ");
  42.        
  43.                 int subject_choice = input.nextInt();
  44.                 if (subject_choice == 1){
  45.                     System.out.println("Enter the password provided by the department to gain access to the ICT portal");
  46.                     while (true){
  47.                     System.out.println("Your password: ");
  48.                     Scanner inp = new Scanner(System.in);
  49.                     int teacher_password = inp.nextInt();
  50.                     line_break();
  51.                         if (teacher_password == 1532) {
  52.                         System.out.println("*********Access granted*********");
  53.                         break;
  54.                         }
  55.                         else {
  56.                         System.out.println("Invalid. Type Again");
  57.                         }
  58.                     }
  59.            
  60.                     while (true){        
  61.                         line_break();
  62.                         System.out.println("You are the teacher of ICT");
  63.                         System.out.println("Setup your portal by creating student profiles");
  64.                         line_break();
  65.                         style1();
  66.                         Scanner y = new Scanner(System.in);
  67.                         System.out.println("Enter your name: ");
  68.                         String name = y.nextLine();
  69.                         System.out.println("Enter your roll: ");
  70.                         String roll = y.nextLine();
  71.                         for (int i=0; i < name_l.length; i++ ){
  72.                             if (name_l[i] == null){
  73.                                 name_l[i] = name;
  74.                                 roll_l[i] = roll;
  75.                                 break;
  76.                             }
  77.                         }
  78.                         for (int i=0; i < name_l.length; i++ ){
  79.                             if(name.equals(name_l[i])&& roll.equals(roll_l[i])){
  80.                             All_method_call();
  81.                             break;
  82.                             }
  83.                         }
  84.                
  85.            
  86.                         System.out.println("Do You want to enter marks of another student? For Yes Press 1. For No Press 0");
  87.                         System.out.println("Your Choice: ");
  88.                         Scanner x = new Scanner(System.in);
  89.                         int choice_2 = x.nextInt();
  90.                         if (choice_2 == 1) {
  91.                             continue;
  92.                         }
  93.                         else {
  94.                             break;
  95.                         }
  96.                     }
  97.            
  98.                     System.out.print("If You want to edit the marks/credentials of current student Press 2. For NO press 0");
  99.                     Scanner ch1 = new Scanner(System.in);
  100.                     System.out.println("Your Choice: ");
  101.                     int choice2 = ch1.nextInt();
  102.                     if (choice2 == 1) {
  103.                         line_break();
  104.                     }
  105.                     else if (choice2 == 2){
  106.                         System.out.println("*****************USER DATA MODIFICATION PANEL*****************");
  107.                         line_break();
  108.                
  109.                         line_break();
  110.                         System.out.println("-To Change name and roll. no of current user.         Press 1");
  111.                         System.out.println("-To Delete Record of a current user.                  Press 2");
  112.                         System.out.println("-To Change Quiz Marks of a student.                   Press 3");
  113.                         System.out.println("-To Change Assignment marks of student.               Press 4");
  114.                         System.out.println("-To Change OHT1 Marks of a student.                   Press 5");
  115.                         System.out.println("-To Change OHT2 Marks of a student.                   press 6");
  116.                         System.out.println("-To Change Terminal Marks of a student.               Press 7");
  117.                         System.out.println("-Again Entry                                          Press 8");
  118.                         System.out.println("-To End the Program.                                  Press 0");
  119.                         line_break();
  120.                         while (true) {
  121.                             System.out.println("Enter Your Choice: ");
  122.                             choice = ch1.nextInt();
  123.                             if (choice == 1){
  124.                                 name_change();
  125.                                 roll_change();
  126.                                 wh_tab();
  127.                                 line_break();
  128.                                 modifi_pane();
  129.                             }
  130.                             else if (choice == 2){
  131.                                 delete_record();
  132.                                 wh_tab();
  133.                                 line_break();
  134.                                 modifi_pane();
  135.                             }
  136.                    
  137.                             else if (choice == 3){
  138.                                 quiz_entry_change();
  139.                                 wh_tab();
  140.                                 line_break();
  141.                                 modifi_pane();
  142.                             }
  143.                             else if (choice == 4) {
  144.                                 assigment_entry();
  145.                                 wh_tab();
  146.                                 line_break();
  147.                                 modifi_pane();
  148.                             }
  149.                             else if (choice == 5) {
  150.                                 OHT1_entry();
  151.                                 wh_tab();
  152.                                 line_break();
  153.                                 modifi_pane();
  154.                             }
  155.                             else if (choice == 6) {
  156.                                 OHT2_entry();
  157.                                 wh_tab();
  158.                                 line_break();
  159.                                 modifi_pane();
  160.                             }
  161.                             else if (choice == 7) {
  162.                                 Terminal_entry();
  163.                                 wh_tab();
  164.                                 line_break();
  165.                                 modifi_pane();
  166.                             }
  167.                             else if (choice == 0) {
  168.                                 break;
  169.                             }
  170.                             else if (choice == 8) {
  171.                                 Scanner y = new Scanner(System.in);
  172.                                 System.out.println("Enter your names: ");
  173.                                 String name = y.nextLine();
  174.                                 System.out.println("Enter your rolls: ");
  175.                                 String roll = y.nextLine();
  176.                                 for (int i=0; i < name_l.length; i++ ){
  177.                                     if (name_l[i] == null){
  178.                                         name_l[i] = name;
  179.                                         roll_l[i] = roll;
  180.                                         All_method_call();
  181.                                         result();
  182.                                         wh_tab();
  183.                                         line_break();
  184.                                         modifi_pane();
  185.                                         break;
  186.                                     }
  187.                                 }
  188.                             }
  189.                         }          
  190.                     }          
  191.                 }
  192.         //================================================= FOR ECA SUBJECT =================================================#
  193.                 else if (subject_choice == 1){
  194.                     System.out.println("Enter the password provided by the department to gain access to the ICT portal");
  195.                     while (true){
  196.                     System.out.println("Your password: ");
  197.                     Scanner inp = new Scanner(System.in);
  198.                     int teacher_password = inp.nextInt();
  199.                     line_break();
  200.                         if (teacher_password == 1532) {
  201.                         System.out.println("*********Access granted*********");
  202.                         break;
  203.                         }
  204.                         else {
  205.                         System.out.println("Invalid. Type Again");
  206.                         }
  207.                     }
  208.            
  209.                     while (true){        
  210.                         line_break();
  211.                         System.out.println("You are the teacher of ICT");
  212.                         System.out.println("Setup your portal by creating student profiles");
  213.                         line_break();
  214.                         style1();
  215.                         Scanner y = new Scanner(System.in);
  216.                         System.out.println("Enter your name: ");
  217.                         String name = y.nextLine();
  218.                         System.out.println("Enter your roll: ");
  219.                         String roll = y.nextLine();
  220.                         for (int i=0; i < name_l.length; i++ ){
  221.                             if (name_l[i] == null){
  222.                                 name_l[i] = name;
  223.                                 roll_l[i] = roll;
  224.                                 break;
  225.                             }
  226.                         }
  227.                         for (int i=0; i < name_l.length; i++ ){
  228.                             if(name.equals(name_l[i])&& roll.equals(roll_l[i])){
  229.                             All_method_call();
  230.                             wh_tab();
  231.                             break;
  232.                             }
  233.                         }
  234.                
  235.            
  236.                         System.out.println("Do You want to enter marks of another student? For Yes Press 1. For No Press 0");
  237.                         System.out.println("Your Choice: ");
  238.                         Scanner x = new Scanner(System.in);
  239.                         int choice_2 = x.nextInt();
  240.                         if (choice_2 == 1) {
  241.                             continue;
  242.                         }
  243.                         else {
  244.                             break;
  245.                         }
  246.                     }
  247.            
  248.                     System.out.print("If You want to edit the marks/credentials of current student Press 2. For NO press 0");
  249.                     Scanner ch1 = new Scanner(System.in);
  250.                     System.out.println("Your Choice: ");
  251.                     int choice2 = ch1.nextInt();
  252.                     if (choice2 == 1) {
  253.                         line_break();
  254.                     }
  255.                     else if (choice2 == 2){
  256.                         System.out.println("*****************USER DATA MODIFICATION PANEL*****************");
  257.                         line_break();
  258.                
  259.                         line_break();
  260.                         System.out.println("-To Change name and roll. no of current user.         Press 1");
  261.                         System.out.println("-To Delete Record of a current user.                  Press 2");
  262.                         System.out.println("-To Change Quiz Marks of a student.                   Press 3");
  263.                         System.out.println("-To Change Assignment marks of student.               Press 4");
  264.                         System.out.println("-To Change OHT1 Marks of a student.                   Press 5");
  265.                         System.out.println("-To Change OHT2 Marks of a student.                   press 6");
  266.                         System.out.println("-To Change Terminal Marks of a student.               Press 7");
  267.                         System.out.println("-Again Entry                                          Press 8");
  268.                         System.out.println("-To End the Program.                                  Press 0");
  269.                         line_break();
  270.                         while (true) {
  271.                             System.out.println("Enter Your Choice: ");
  272.                             choice = ch1.nextInt();
  273.                             if (choice == 1){
  274.                                 name_change();
  275.                                 roll_change();
  276.                                 wh_tab();
  277.                             }
  278.                             else if (choice == 2){
  279.                                 delete_record();
  280.                             }
  281.                    
  282.                             else if (choice == 3){
  283.                                 quiz_entry_change();
  284.                             }
  285.                             else if (choice == 4) {
  286.                                 assigment_entry();
  287.                             }
  288.                             else if (choice == 5) {
  289.                                 OHT1_entry();
  290.                             }
  291.                             else if (choice == 6) {
  292.                                 OHT2_entry();
  293.                             }
  294.                             else if (choice == 7) {
  295.                                 Terminal_entry();
  296.                             }
  297.                             else if (choice == 8) {
  298.                                 Scanner y = new Scanner(System.in);
  299.                                 System.out.println("Enter your names: ");
  300.                                 String name = y.nextLine();
  301.                                 System.out.println("Enter your rolls: ");
  302.                                 String roll = y.nextLine();
  303.                                 for (int i=0; i < name_l.length; i++ ){
  304.                                     if (name_l[i] == null){
  305.                                         name_l[i] = name;
  306.                                         roll_l[i] = roll;
  307.                                         All_method_call();
  308.                                         result();
  309.                                         break;
  310.                                     }
  311.                                 }
  312.                             }
  313.                         }          
  314.                     }          
  315.                 }
  316.                 //================================================= FOR CAL SUBJECT =================================================#
  317.                 else if (subject_choice == 1){
  318.                     System.out.println("Enter the password provided by the department to gain access to the ICT portal");
  319.                     while (true){
  320.                     System.out.println("Your password: ");
  321.                     Scanner inp = new Scanner(System.in);
  322.                     int teacher_password = inp.nextInt();
  323.                     line_break();
  324.                         if (teacher_password == 1532) {
  325.                         System.out.println("*********Access granted*********");
  326.                         break;
  327.                         }
  328.                         else {
  329.                         System.out.println("Invalid. Type Again");
  330.                         }
  331.                     }
  332.            
  333.                     while (true){        
  334.                         line_break();
  335.                         System.out.println("You are the teacher of ICT");
  336.                         System.out.println("Setup your portal by creating student profiles");
  337.                         line_break();
  338.                         style1();
  339.                         Scanner y = new Scanner(System.in);
  340.                         System.out.println("Enter your name: ");
  341.                         String name = y.nextLine();
  342.                         System.out.println("Enter your roll: ");
  343.                         String roll = y.nextLine();
  344.                         for (int i=0; i < name_l.length; i++ ){
  345.                             if (name_l[i] == null){
  346.                                 name_l[i] = name;
  347.                                 roll_l[i] = roll;
  348.                                 break;
  349.                             }
  350.                         }
  351.                         for (int i=0; i < name_l.length; i++ ){
  352.                             if(name.equals(name_l[i])&& roll.equals(roll_l[i])){
  353.                             All_method_call();
  354.                             wh_tab();
  355.                             break;
  356.                             }
  357.                         }
  358.                
  359.            
  360.                         System.out.println("Do You want to enter marks of another student? For Yes Press 1. For No Press 0");
  361.                         System.out.println("Your Choice: ");
  362.                         Scanner x = new Scanner(System.in);
  363.                         int choice_2 = x.nextInt();
  364.                         if (choice_2 == 1) {
  365.                             continue;
  366.                         }
  367.                         else {
  368.                             break;
  369.                         }
  370.                     }
  371.            
  372.                     System.out.print("If You want to edit the marks/credentials of current student Press 2. For NO press 0");
  373.                     Scanner ch1 = new Scanner(System.in);
  374.                     System.out.println("Your Choice: ");
  375.                     int choice2 = ch1.nextInt();
  376.                     if (choice2 == 1) {
  377.                         line_break();
  378.                     }
  379.                     else if (choice2 == 2){
  380.                         System.out.println("*****************USER DATA MODIFICATION PANEL*****************");
  381.                         line_break();
  382.                
  383.                         line_break();
  384.                         System.out.println("-To Change name and roll. no of current user.         Press 1");
  385.                         System.out.println("-To Delete Record of a current user.                  Press 2");
  386.                         System.out.println("-To Change Quiz Marks of a student.                   Press 3");
  387.                         System.out.println("-To Change Assignment marks of student.               Press 4");
  388.                         System.out.println("-To Change OHT1 Marks of a student.                   Press 5");
  389.                         System.out.println("-To Change OHT2 Marks of a student.                   press 6");
  390.                         System.out.println("-To Change Terminal Marks of a student.               Press 7");
  391.                         System.out.println("-Again Entry                                          Press 8");
  392.                         System.out.println("-To End the Program.                                  Press 0");
  393.                         line_break();
  394.                         while (true) {
  395.                             System.out.println("Enter Your Choice: ");
  396.                             choice = ch1.nextInt();
  397.                             if (choice == 1){
  398.                                 name_change();
  399.                                 roll_change();
  400.                                 wh_tab();
  401.                                 modifi_pane();
  402.                             }
  403.                             else if (choice == 2){
  404.                                 delete_record();
  405.                                 wh_tab();
  406.                                 modifi_pane();
  407.                             }
  408.                    
  409.                             else if (choice == 3){
  410.                                 quiz_entry_change();
  411.                                 wh_tab();
  412.                                
  413.                             }
  414.                             else if (choice == 4) {
  415.                                 assigment_entry();
  416.                                 wh_tab();
  417.                                 modifi_pane();
  418.                             }
  419.                             else if (choice == 5) {
  420.                                 OHT1_entry();
  421.                                 wh_tab();
  422.                                 modifi_pane();
  423.                             }
  424.                             else if (choice == 6) {
  425.                                 OHT2_entry();
  426.                                 wh_tab();
  427.                                 modifi_pane();
  428.                             }
  429.                             else if (choice == 7) {
  430.                                 Terminal_entry();
  431.                                 wh_tab();
  432.                                 modifi_pane();
  433.                             }
  434.                             else if (choice == 0) {
  435.                                 break;
  436.                             }
  437.                             else if (choice == 8) {
  438.                                 Scanner y = new Scanner(System.in);
  439.                                 System.out.println("Enter your names: ");
  440.                                 String name = y.nextLine();
  441.                                 System.out.println("Enter your rolls: ");
  442.                                 String roll = y.nextLine();
  443.                                 for (int i=0; i < name_l.length; i++ ){
  444.                                     if (name_l[i] == null){
  445.                                         name_l[i] = name;
  446.                                         roll_l[i] = roll;
  447.                                         All_method_call();
  448.                                         result();
  449.                                         break;
  450.                                     }
  451.                                 }
  452.                             }    
  453.                         }          
  454.                     }          
  455.                 }  
  456.             }
  457.            
  458.             if (choice == 2) {
  459.                 line_break();
  460.                 System.out.println("You are the student");
  461.                 line_break();
  462.                 Scanner n = new Scanner(System.in);
  463.                 System.out.println("Enter your name: ");
  464.                 String name = n.next();
  465.                 System.out.println("Enter your roll: ");
  466.                 String roll = n.next();
  467.                 for (int i=0; i < name_l.length;i++) {
  468.                     if (name_l[i] == name && roll_l[i] == roll){
  469.                         System.out.println("--Access granted to the user: " + name_l[i]);
  470.                         line_break();
  471.                         System.out.println("========================================================================================================");
  472.                         System.out.printf("%12s |  %12s | %12s | %12s | %12s | %12s | %12s|" , "Name", "Roll.no", "quizes", "Assign", "OHT1", "OHT2","Terminal");
  473.                         System.out.printf("%12s |  %12s | %12s | %12s | %12s | %12s | %12s|" , name_l[i], roll_l[i], quiz_m[i], assig_m[i], OHT1_m[i], OHT2_m[i], Finals_m[i]);
  474.                         System.out.println("========================================================================================================");
  475.                     }
  476.                 }
  477.                
  478.             }
  479.         }
  480.     }
  481.    
  482.    
  483. public static void line_break(){
  484.         System.out.println();
  485.         System.out.println();
  486.     }
  487.  
  488.  
  489.  
  490.  
  491.     public static void quiz() {
  492.         style8();
  493.         double quiz_marks ;
  494.         Scanner input = new Scanner(System.in);
  495.         System.out.println("Enter the marks of the quiz");
  496.         quiz_marks = input.nextInt();
  497.         System.out.println("Enter the total marks of the quiz: ");
  498.         double total_quiz_marks;
  499.         total_quiz_marks = input.nextInt();
  500.         System.out.print("15% weightage of quiz: ");
  501.         double quiz15percent;
  502.         quiz15percent = (quiz_marks*100/total_quiz_marks *15/100);
  503.         quiz15percent =Math.round(quiz15percent*100.0)/100.0;
  504.         System.out.println(quiz15percent);
  505.         for(int i =0; i<= quiz_m.length; i++) {
  506.             if (quiz_m[i] == 0) {
  507.                 quiz_m[i] = quiz15percent;
  508.                 break;
  509.             }
  510.         }
  511.         style8();
  512.         line_break();
  513.  
  514.     }
  515.  
  516.     public static void assignment() {
  517.         style8();
  518.         double assig_marks ;
  519.         Scanner input = new Scanner(System.in);
  520.         System.out.println("Enter the marks of the assignment");
  521.         assig_marks = input.nextInt();
  522.         System.out.println("Enter the total marks of the assignment: ");
  523.         double total_assig_marks;
  524.         total_assig_marks = input.nextInt();
  525.         System.out.print("10% weightage of assigment: ");
  526.         double assig10percent;
  527.         assig10percent = (assig_marks*100/total_assig_marks *10/100);
  528.         assig10percent = Math.round(assig10percent*100.0)/100.0;
  529.         System.out.println(assig10percent);
  530.         for(int i =0; i<= assig_m.length; i++) {
  531.             if (assig_m[i] == 0) {
  532.                 assig_m[i] = assig10percent;
  533.                 break;
  534.             }
  535.         }
  536.         style8();
  537.         line_break();
  538.     }
  539.  
  540.     public static void OHT1() {
  541.         style8();
  542.         double OHT1_marks ;
  543.         Scanner input = new Scanner(System.in);
  544.         System.out.println("Enter the marks of the Sessional 1");
  545.         OHT1_marks = input.nextInt();
  546.         System.out.println("Enter the total marks of the Sessional 1: ");
  547.         double total_OHT1_marks;
  548.         total_OHT1_marks = input.nextInt();
  549.         System.out.print("10% weightage of Sessional 1: ");
  550.         double OHT10percent;
  551.         OHT10percent = (OHT1_marks*100/total_OHT1_marks *10/100);
  552.         OHT10percent = Math.round(OHT10percent*100.0)/100.0;
  553.         System.out.println(OHT10percent);
  554.         for(int i =0; i<= OHT1_m.length; i++) {
  555.             if (OHT1_m[i] == 0) {
  556.                 OHT1_m[i] = OHT10percent;
  557.                 break;
  558.             }
  559.         }
  560.         style8();
  561.         line_break();
  562.     }
  563.  
  564.     public static void OHT2() {
  565.         style8();
  566.         double OHT2_marks ;
  567.         Scanner input = new Scanner(System.in);
  568.         System.out.println("Enter the marks of the Sessional 2");
  569.         OHT2_marks = input.nextInt();
  570.         System.out.println("Enter the total marks of the Sessional 2: ");
  571.         double total_OHT2_marks;
  572.         total_OHT2_marks = input.nextInt();
  573.         System.out.print("15% weightage of Sessional 2: ");
  574.         double OHT15percent;
  575.         OHT15percent = (OHT2_marks*100/total_OHT2_marks *15/100);
  576.         OHT15percent = Math.round(OHT15percent*100.0)/100.0;
  577.         System.out.println(OHT15percent);
  578.         for(int i =0; i<= OHT2_m.length; i++) {
  579.             if (OHT2_m[i] == 0) {
  580.                 OHT2_m[i] = OHT15percent;
  581.                 break;
  582.             }
  583.         }
  584.         style8();
  585.         line_break();
  586.     }
  587.  
  588.  
  589.     public static void Finals() {
  590.         style8();
  591.         double Finals_marks;
  592.         Scanner input = new Scanner(System.in);
  593.         System.out.println("Enter the marks of the Finals");
  594.         Finals_marks = input.nextInt();
  595.         System.out.println("Enter the total marks of the Finals: ");
  596.         double total_Finals_marks;
  597.         total_Finals_marks = input.nextInt();
  598.         System.out.print("15% weightage of Finals: ");
  599.         double Finals50percent;
  600.         Finals50percent = (Finals_marks*100/total_Finals_marks *50/100);
  601.         Finals50percent = Math.round(Finals50percent*100.0)/100.0;
  602.         System.out.println(Finals50percent);
  603.         for(int i =0; i<= Finals_m.length; i++) {
  604.             if (Finals_m[i] == 0) {
  605.                 Finals_m[i] = Finals50percent;
  606.                 break;
  607.             }
  608.         }
  609.         style8();
  610.         line_break();
  611.     }
  612.  
  613.    
  614.     public static void result(){
  615.     for (int i = 0; i < name_l.length; i++) {
  616.         if (name_l[i] != null){
  617.         style5();
  618.     System.out.println("The following is the record for student: " + name_l[i]);
  619.     System.out.println("The Roll number of the student is : " + roll_l[i]);
  620.     line_break();
  621.     System.out.println("The projected total in quiz is : " + quiz_m[i]);
  622.     System.out.println("The projected total in assignment is : " + assig_m[i]);
  623.     System.out.println("The projected total in Sessional 1 is : " + OHT1_m[i]);
  624.     System.out.println("The projected total in Sessional 2 is : " + OHT2_m[i]);
  625.     System.out.println("The Projected total in Terminal is : " + Finals_m[i]);
  626.     double end_result = quiz_m[i]+assig_m[i]+OHT1_m[i]+OHT2_m[i]+Finals_m[i];
  627.     double p_result =  Math.round(end_result*100.0)/100.0;
  628.     System.out.println("The end result out of 100 is: "+ end_result);
  629.     line_break();
  630.     if (end_result <= 50) {
  631.            System.out.println("The student is Fail and the grade is F");
  632.        }
  633.        if (50 <= p_result && p_result <= 54) {
  634.            System.out.println("The student is on probation and the grade is D");
  635.        }
  636.        if (55 <= p_result && p_result <= 59) {
  637.            System.out.println("The student is on probation and the grade is C-");
  638.        }
  639.        if (60 <= p_result && p_result <= 64) {
  640.            System.out.println("The CGPA is 2.0 and the grade is C");
  641.        }
  642.        if (65 <= p_result && p_result <= 69) {
  643.            System.out.println("The CGPA is 2.3 and the grade is C+");
  644.        }
  645.        if (70 <= p_result && p_result <= 74) {
  646.            System.out.println("The CGPA is 2.7 and the grade is B-");
  647.        }
  648.        if (75 <= p_result && p_result <= 79) {
  649.            System.out.println("The CGPA is 3.0 and the grade is B");
  650.        }
  651.        if (80 <= p_result && p_result <= 84) {
  652.            System.out.println("The CGPA is 3.3 and the grade is B+");
  653.        }
  654.        if (85 <= p_result && p_result <= 89) {
  655.            System.out.println("The CGPA is 3.7 and the grade is A");
  656.        }
  657.        if (p_result >= 89){
  658.            System.out.println("The CGPA is 4.0 and the grade is A+");
  659.        }
  660.     wh_tab();
  661.     }
  662.     }
  663.      
  664.       style5();
  665.       line_break();
  666.  
  667. }
  668.     public static void All_method_call() {
  669.         quiz();
  670.         assignment();
  671.         OHT1();
  672.         OHT2();
  673.         Finals();
  674.         result();
  675.     }
  676.  
  677. //#========================== NAME UPDATE ================================#
  678. public static void name_change() {
  679.     Scanner input = new Scanner(System.in);
  680.     System.out.println("Type the name of the student you want to update");
  681.     String name = input.nextLine();
  682.     for (int i = 0; i < name_l.length; i++) {
  683.         if(name.equals(name_l[i])){
  684.             System.out.println("Type the UPDATED NAME: ");
  685.             String new_name = input.nextLine();
  686.             name_l[i] = new_name;
  687.             System.out.println("---Change Successful---");
  688.             System.out.println(name_l[i]);
  689.             line_break();
  690.             result();
  691.            
  692.         }
  693.     }
  694. }
  695. //#=======================================================================#
  696.  
  697. //#======================== ROLL UPDATE ==================================#
  698. public static void roll_change() {
  699.         Scanner input = new Scanner(System.in);
  700.         System.out.println("Type the roll number of the student you want to update");
  701.         String roll = input.nextLine();
  702.         for (int i = 0; i < name_l.length; i++) {
  703.             if(roll.equals(roll_l[i])){
  704.                 System.out.println("Type the UPDATED ROLL NUMBER: ");
  705.                 String new_roll = input.nextLine();
  706.                 roll_l[i] = new_roll;
  707.                 System.out.println("---Change Successful---");
  708.                 line_break();
  709.                 result();
  710.                         }
  711.         }
  712. }
  713.  
  714. //#========================================================================#
  715.  
  716. //#========================== DELETE RECORD =============================#
  717. public static void delete_record(){
  718.         Scanner input = new Scanner(System.in);
  719.         System.out.println("Type the name of the student you want to delete record of: ");
  720.         String name = input.nextLine();
  721.         for (int i = 0; i < name_l.length; i++) {
  722.             if(name.equals(name_l[i])){
  723.                 name_l[i] = null;
  724.                 roll_l[i] = null;
  725.                 quiz_m[i] = 0;
  726.                 System.out.println("---Delete Successful---");
  727.                 result();
  728.             }
  729.         }
  730. }
  731. //#========================================================================#            
  732.    
  733. //#======1====================== QUIZ RECORD UPDATE ==============================#
  734. public static void quiz_entry_change(){
  735.         Scanner input = new Scanner(System.in);
  736.         System.out.println("Enter the name of the student you want to enter Quiz marks: ");
  737.         String name = input.nextLine();
  738.         for (int i = 0; i <name_l.length; i++) {
  739.         if(name.equals(name_l[i])){
  740.             System.out.println("Enter Quiz Marks for student ");
  741.             int quiz_marks = input.nextInt();
  742.             quiz_m[i] = quiz_marks;
  743.             System.out.println("---Change Successful---");
  744.            System.out.println(quiz_m[i]);
  745.            result();
  746.         }
  747.         }
  748. }
  749.            
  750. //#================================================================================#  
  751.  
  752. //#=============================== ASSIGNMENT RECORD UPDATE ===============================#
  753. public static void assigment_entry(){
  754.     Scanner input = new Scanner(System.in);
  755.         System.out.println("Enter the name of the student you want to enter Assignment marks: ");
  756.         String name = input.nextLine();
  757.         for (int i = 0; i < name_l.length; i++) {
  758.         if(name.equals(name_l[i])){
  759.             System.out.println("Enter Assignment Marks for student ");
  760.             int assig_marks = input.nextInt();
  761.             assig_m[i] = assig_marks;
  762.             System.out.println("---Change Successful---");
  763.             result();
  764.            
  765.         }
  766.         }
  767. }
  768. //#==========================================================================================#        
  769.  
  770. //#=========================== SESSIONAL 1 RECORD UPDATE ==================================#
  771. public static void OHT1_entry(){
  772.     Scanner input = new Scanner(System.in);
  773.         System.out.println("Enter the name of the student you want to enter Sessional 1 marks: ");
  774.         String name = input.nextLine();
  775.         for (int i = 0; i < name_l.length; i++) {
  776.         if(name.equals(name_l[i])){
  777.             System.out.println("Enter new Sessional 1 Marks for student ");
  778.             int OHT1_marks = input.nextInt();
  779.             OHT1_m[i] = OHT1_marks;
  780.             System.out.println("---Change Successful---");
  781.             result();
  782.            
  783.         }
  784.         }
  785. }
  786. //#========================================================================================#        
  787.  
  788. //#============================= SESSIONAL 2 RECORD UPDATE =============================#
  789. public static void OHT2_entry(){
  790.     Scanner input = new Scanner(System.in);
  791.         System.out.println("Enter the name of the student you want to enter Sessional 2 marks: ");
  792.         String name = input.nextLine();
  793.         for (int i = 0; i < name_l.length; i++) {
  794.         if(name.equals(name_l[i])){
  795.             System.out.println("Enter new Sessional 2 Marks for student ");
  796.             int OHT2_marks = input.nextInt();
  797.             OHT1_m[i] = OHT2_marks;
  798.             System.out.println("---Change Successful---");
  799.             result();
  800.         }
  801.         }
  802. }
  803. //#==================================== TERMINAL UPDATE ====================================#
  804. public static void Terminal_entry(){
  805.    Scanner input = new Scanner(System.in);
  806.         System.out.println("Enter the name of the student you want to enter Sessional 2 marks: ");
  807.         String name = input.nextLine();
  808.         for (int i = 0; i < name_l.length; i++) {
  809.         if(name.equals(name_l[i])){
  810.             System.out.println("Enter new Sessional 2 Marks for student ");
  811.             int Finals_marks = input.nextInt();
  812.             Finals_m[i] = Finals_marks;
  813.             System.out.println("---Change Successful---");
  814.             result();
  815.         }
  816.         }
  817. }
  818.  
  819. //#========================================================================================#
  820.  
  821.  
  822. public static void style1(){
  823.         System.out.println("-----------------------------------------------");
  824.     }
  825.     public static void style2(){
  826.         System.out.println("-----------------------------------------------");
  827.     }
  828.     public static void style3(){
  829.         System.out.println("################################################");
  830.     }
  831.     public static void style4(){
  832.         System.out.println("................................................");
  833.     }
  834.     public static void style5(){
  835.         System.out.println("************************************************");
  836.     }
  837.     public static void style6(){
  838.         System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  839.     }
  840.     public static void style7(){
  841.         System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++");
  842.     }
  843.     public static void style8(){
  844.         System.out.println("================================================");
  845.     }
  846.  
  847. public static void wh_tab() {
  848.     System.out.println("========================================================================================================");
  849.     System.out.printf("%12s|  %12s| %12s| %12s| %12s| %12s| %12s|\n",  "Name", "Roll.no", "quizes", "Assign", "OHT1", "OHT2","Terminal");    
  850.     for (int i = 0; i < name_l.length; i++){
  851.         if (name_l != null && roll_l != null && quiz_m[i] != 0){
  852.             System.out.printf("%12s|  %12s| %12s| %12s| %12s| %12s| %12s|\n" , name_l[i], roll_l[i], quiz_m[i], assig_m[i], OHT1_m[i], OHT2_m[i], Finals_m[i]);
  853.         }
  854.     }
  855.     System.out.println("========================================================================================================");
  856. }
  857.  
  858. public static void modifi_pane(){
  859.                         System.out.println("-To Change name and roll. no of current user.         Press 1");
  860.                         System.out.println("-To Delete Record of a current user.                  Press 2");
  861.                         System.out.println("-To Change Quiz Marks of a student.                   Press 3");
  862.                         System.out.println("-To Change Assignment marks of student.               Press 4");
  863.                         System.out.println("-To Change OHT1 Marks of a student.                   Press 5");
  864.                         System.out.println("-To Change OHT2 Marks of a student.                   press 6");
  865.                         System.out.println("-To Change Terminal Marks of a student.               Press 7");
  866.                         System.out.println("-Again Entry                                          Press 8");
  867.                         System.out.println("-To End the Program.                                  Press 0");
  868.                         line_break();
  869. }
  870.  
  871. }
Add Comment
Please, Sign In to add comment