Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExelentStudent {
- String name;
- double average;
- boolean principalLove;
- public ExelentStudent(String name, double average, boolean principalLove) {
- this.name = name;
- this.average = average;
- this.principalLove = principalLove;
- }
- public void famelyDonateAlot() {
- if(average*1.1 <= 100)
- average *= 1.1;
- else
- average = 100;
- }
- public int compare(ExelentStudent other) {
- if((this.principalLove == true && other.isPrincipalLove() == true) || (this.principalLove == false && other.isPrincipalLove() == false)) {
- if(this.average == other.getAverage())
- return 0;
- else if(this.average > other.getAverage())
- return 1;
- else
- return -1;
- }
- if(this.principalLove == true && other.isPrincipalLove() == false)
- return 1;
- return -1;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public double getAverage() {
- return average;
- }
- public void setAverage(double average) {
- this.average = average;
- }
- public boolean isPrincipalLove() {
- return principalLove;
- }
- public void setPrincipalLove(boolean principalLove) {
- this.principalLove = principalLove;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement