Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Qlab5 {
- public Qlab5() {
- }
- }
- class Registration{
- private PriorityQueue <Student> ogline;
- private Queue <Student> reline;
- class Student implements Comparable{
- private Sring name;
- private int age;
- public Student(String n, int a)
- {
- name= n;
- age=a;
- }
- public String toString()
- {
- return name+ " " + age;
- }
- public int compareTo(int g)
- {
- return a-g;
- }
- }
- public Registration()
- {
- ogline=new LinkedList<Student>();
- reline=new LinkedList<Student>();
- }
- public void enterLine()
- {
- Scanner f=new Scanner(System.in);
- String n;
- int g;
- System.out.print("Enter the student's name ==> ");
- n=f.nextLine();
- System.out.print("Enter the student's grade ==> ");
- g=f.nextLine();
- Student student=new Student(n,g);
- ogline.add(student);
- }
- public void displayOriginalLine()
- {
- private PriorityQueue <Student> ogline2;
- while(!ogline.isEmpty())
- {
- ogline2.add(ogline.peek());
- System.out.print(ogline.remove());
- }
- while(!ogline2.isEmpty())
- {
- ogline.add(ogline2.remove());
- }
- }
- public void disperseLine()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement