Question
I need help in converting this into pseudo-code Student.java public class Student implements Comparable { private String name, major, status; private int rank; public Student()
I need help in converting this into pseudo-code
Student.java
public class Student implements Comparable
public String getName() { return name; }
public String getMajor() { return major; }
public String getStatus() { return status; } public int getRank() { return this.rank; } public void setRank(int rank) { this.rank = rank; } @Override public String toString() { return("Name: " + this.name + ", Major: " + this.major + ", Status: " + this.status); }
@Override public int compareTo(Student o) { if(this.rank < o.getRank()) return -1; else if(this.rank == o.getRank()) return 0; else return 1; } }
RankIndividuals.java
import java.util.ArrayList; import java.util.Collections;
public class RankIndividuals { private ArrayList
RankerApp.java (Main class)
public class RankerApp { public static void main(String[] args) { RankIndividuals individuals = new RankIndividuals(); individuals.addStudents(new Student("John", "Computer Science", "Good")); individuals.addStudents(new Student("Alice", "Geography", "Excellent")); individuals.addStudents(new Student("Henry", "Physics", "Average")); individuals.addStudents(new Student("Maxx", "English", "Bad")); individuals.addStudents(new Student("Joseph", "Chemistry", "Average")); individuals.addStudents(new Student("Nuke", "Mathematics", "Very Good")); System.out.println("STUDENTS BEFORE RANKING: ------------------------"); individuals.displayAllStudents(); individuals.giveRank(); System.out.println(" STUDENTS AFTER RANKING: -----------------------"); individuals.displayAllStudents(); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started