Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- //POLYMORPHISM
- class intro
- {
- public void greet()
- {
- System.out.println("Property of gcSchool");
- }
- }
- class ending extends intro
- {
- public void greet()
- {
- super.greet();
- System.out.println("Transaction Complete!");
- }
- }
- //MAIN CLASS
- public class mainClass {
- public static void main (String[] args)
- {
- Scanner s = new Scanner(System.in);
- String user, password;
- System.out.println("----------------------");
- System.out.println("| Registrar |");
- System.out.println("----------------------");
- System.out.print("Username: ");
- user = s.nextLine();
- System.out.print("Password: ");
- password = s.nextLine();
- if(user.equalsIgnoreCase("admin") && password.equalsIgnoreCase("admin"))
- {
- System.out.println("-----------------------------------------------------");
- System.out.println("|Welcome to the Registrar Account how can help you?|");
- System.out.println("-----------------------------------------------------");
- System.out.println();
- intro introw = new intro();
- introw.greet();
- System.out.println();
- System.out.println("*Enrollment");
- System.out.println("");
- System.out.println("*Pay Bills");
- System.out.println("");
- System.out.print("Choose Categories: ");
- String choose = s.nextLine();
- System.out.println("---------------------------------------------------");
- if(choose.equalsIgnoreCase("enrollment"))
- {
- System.out.println("");
- System.out.println("*****************");
- System.out.println("*Enrollment Form*");
- System.out.println("******************");
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your Name: " );
- String a = s.nextLine();
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your Email: ");
- String c = s.nextLine();
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your Address: ");
- String d = s.nextLine();
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your Course: ");
- String e = s.nextLine();
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your year: ");
- String f = s.nextLine();
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your Age: ");
- int b = s.nextInt();
- System.out.println("---------------------------------------------------");
- System.out.print("|Enter Your Contact#: ");
- long g = s.nextLong();
- System.out.println("---------------------------------------------------");
- enrollment enroll = new enrollment();
- enroll.setName(a);
- enroll.setAge(b);
- enroll.setEmail(c);
- enroll.setAddress(d);
- enroll.setCourse(e);
- enroll.setYear(f);
- enroll.setContact(g);
- System.out.println("---------------------------------------------------");
- System.out.println("You are Enrolled!");
- System.out.println("---------------------------------------------------");
- System.out.println("Name: " + enroll.getName());
- System.out.println("Age: " + enroll.getAge());
- System.out.println("Contact#: " + enroll.getContact());
- System.out.println("Email: " + enroll.getEmail());
- System.out.println("Address: " + enroll.getAddress());
- System.out.println("Course: " + enroll.getCourse());
- System.out.println("year: " + enroll.getYear());
- System.out.println("Tuition fee: Php 30000");
- System.out.println("");
- System.out.println("----------------------------------------------------");
- System.out.println("| Proceed to Pay Downpayments! |");
- System.out.println("----------------------------------------------------");
- int lahat = 30000;
- System.out.print("Enter Downpayment: ");
- int dp = s.nextInt();
- payBills bills = new payBills();
- bills.setTotal(lahat,dp);
- if(lahat>dp)
- {
- System.out.println("The Total Balance is: " + bills.getTotal());
- }
- else if(lahat<dp)
- {
- int sum = dp - lahat;
- System.out.println("Fully Paid" + " Change is Php" + sum);
- }
- System.out.println("");
- ending end = new ending();
- end.greet();
- if(dp<=0)
- {
- System.out.println("Didnt Complete The payments Please Fill Up Again");
- System.exit(0);
- }
- }
- else if(choose.equalsIgnoreCase("paybills"))
- {
- System.out.println("Pay Bills! ");
- System.out.println("");
- System.out.print("Monthly or Quarterly: ");
- String ch = s.nextLine();
- payments ments = new payments();
- if(ch.equalsIgnoreCase("monthly"))
- {
- ments.monthly();
- }
- System.out.println("");
- ending ends = new ending();
- ends.greet();
- if(ch.equalsIgnoreCase("quarterly"))
- {
- ments.quarterly();
- }
- }
- }
- else
- {
- System.out.println("Wrong Account!");
- System.exit(0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement