Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.64 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. //POLYMORPHISM
  4. class intro
  5. {
  6.     public void greet()
  7.     {
  8.        
  9.         System.out.println("Property of gcSchool");
  10.        
  11.     }
  12. }
  13. class ending extends intro
  14. {
  15.     public void greet()
  16.     {
  17.         super.greet();
  18.         System.out.println("Transaction Complete!");
  19.     }
  20. }
  21.  
  22.  
  23. //MAIN CLASS
  24. public class mainClass {
  25.  
  26.    public static void main (String[] args)
  27.    {
  28.     Scanner s = new Scanner(System.in);
  29.    
  30.         String user, password;
  31.        
  32.         System.out.println("----------------------");
  33.         System.out.println("|     Registrar      |");
  34.         System.out.println("----------------------");
  35.    
  36.         System.out.print("Username: ");
  37.         user = s.nextLine();
  38.        
  39.         System.out.print("Password: ");
  40.         password = s.nextLine();
  41.        
  42.        
  43.         if(user.equalsIgnoreCase("admin") && password.equalsIgnoreCase("admin"))
  44.         {
  45.            
  46.         System.out.println("-----------------------------------------------------");
  47.         System.out.println("|Welcome to the Registrar Account how can  help you?|");
  48.         System.out.println("-----------------------------------------------------");
  49.        
  50.         System.out.println();
  51.        
  52.         intro introw = new intro();
  53.         introw.greet();
  54.        
  55.         System.out.println();
  56.  
  57.             System.out.println("*Enrollment");
  58.             System.out.println("");
  59.             System.out.println("*Pay Bills");
  60.        
  61.             System.out.println("");
  62.             System.out.print("Choose Categories: ");
  63.             String choose = s.nextLine();
  64.             System.out.println("---------------------------------------------------");
  65.            
  66.             if(choose.equalsIgnoreCase("enrollment"))
  67.             {
  68.                     System.out.println("");
  69.                     System.out.println("*****************");
  70.                     System.out.println("*Enrollment Form*");
  71.                     System.out.println("******************");
  72.                
  73.                 System.out.println("---------------------------------------------------");
  74.                 System.out.print("|Enter Your Name: " );
  75.                 String a = s.nextLine();
  76.                 System.out.println("---------------------------------------------------");
  77.                
  78.                
  79.            
  80.                
  81.                 System.out.print("|Enter Your Email: ");
  82.                 String c = s.nextLine();
  83.                 System.out.println("---------------------------------------------------");
  84.                
  85.                 System.out.print("|Enter Your Address: ");
  86.                 String d = s.nextLine();
  87.                 System.out.println("---------------------------------------------------");
  88.                
  89.                 System.out.print("|Enter Your Course: ");
  90.                 String e = s.nextLine();
  91.                 System.out.println("---------------------------------------------------");
  92.                
  93.                 System.out.print("|Enter Your year: ");
  94.                 String f = s.nextLine();
  95.                 System.out.println("---------------------------------------------------");
  96.            
  97.                 System.out.print("|Enter Your Age: ");
  98.                 int b = s.nextInt();
  99.                 System.out.println("---------------------------------------------------");
  100.                
  101.                 System.out.print("|Enter Your Contact#: ");
  102.                 long g = s.nextLong();
  103.                 System.out.println("---------------------------------------------------");
  104.                
  105.                 enrollment enroll = new enrollment();
  106.                 enroll.setName(a);
  107.                 enroll.setAge(b);
  108.                 enroll.setEmail(c);
  109.                 enroll.setAddress(d);
  110.                 enroll.setCourse(e);
  111.                 enroll.setYear(f);
  112.                 enroll.setContact(g);
  113.                
  114.                 System.out.println("---------------------------------------------------");
  115.                 System.out.println("You are Enrolled!");
  116.                 System.out.println("---------------------------------------------------");
  117.                 System.out.println("Name: " + enroll.getName());
  118.                 System.out.println("Age: " + enroll.getAge());
  119.                 System.out.println("Contact#: " + enroll.getContact());
  120.                 System.out.println("Email: " + enroll.getEmail());
  121.                 System.out.println("Address: " + enroll.getAddress());
  122.                 System.out.println("Course: " + enroll.getCourse());
  123.                 System.out.println("year: " + enroll.getYear());
  124.                
  125.                 System.out.println("Tuition fee: Php 30000");
  126.                 System.out.println("");
  127.                 System.out.println("----------------------------------------------------");
  128.                 System.out.println("|         Proceed to Pay Downpayments!             |");
  129.                 System.out.println("----------------------------------------------------");
  130.                
  131.            
  132.                
  133.                 int lahat = 30000;
  134.                 System.out.print("Enter Downpayment: ");
  135.                 int dp = s.nextInt();
  136.                
  137.                 payBills bills = new payBills();
  138.                 bills.setTotal(lahat,dp);
  139.                
  140.                 if(lahat>dp)
  141.                 {
  142.                     System.out.println("The Total Balance is: " + bills.getTotal());
  143.                 }
  144.                 else if(lahat<dp)
  145.                 {
  146.                     int sum = dp - lahat;
  147.                     System.out.println("Fully Paid" + " Change is Php" + sum);
  148.                 }
  149.                 System.out.println("");        
  150.                 ending end = new ending();
  151.                 end.greet();
  152.                 if(dp<=0)
  153.                 {
  154.                     System.out.println("Didnt Complete The payments Please Fill Up Again");
  155.                     System.exit(0);
  156.                 }
  157.                
  158.             }
  159.            
  160.             else if(choose.equalsIgnoreCase("paybills"))
  161.             {
  162.                 System.out.println("Pay Bills! ");
  163.                 System.out.println("");
  164.                 System.out.print("Monthly or Quarterly: ");
  165.                 String ch = s.nextLine();
  166.                
  167.                 payments ments = new payments();
  168.                 if(ch.equalsIgnoreCase("monthly"))
  169.                 {
  170.                     ments.monthly();
  171.                 }
  172.                 System.out.println("");        
  173.                 ending ends = new ending();
  174.                 ends.greet();
  175.                 if(ch.equalsIgnoreCase("quarterly"))
  176.                 {
  177.                     ments.quarterly();
  178.                 }
  179.             }
  180.         }
  181.         else
  182.         {
  183.             System.out.println("Wrong Account!");
  184.             System.exit(0);
  185.         }
  186.     }
  187.    
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement