import java.text.*;
import java.util.Scanner;
public class SortPet
{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
Pet p1 = new Pet("Daisy",7,12.6);
Pet p2 = new Pet("Heidi",4,10.5);
Pet p3 = new Pet("Indy",5,5.7);
Pet p4 = new Pet("Kitty",2,3.5);
Pet p5 = new Pet("Lucy",5,5.2);
Pet p6 = new Pet("Maggie",3,2.6);
Pet p7 = new Pet("Mimi",6,7.8);
Pet p8 = new Pet("Sassy",1,2.5);
Pet[] petArray = {p1, p2,p3, p4,p5,p6,p7,p8};
sortName(petArray);
//for(int i =0; i<=7;i++){
// petArray[i].displayPet();}
System.out.println("What do you want to sort?");
System.out.println("1 for Name");
System.out.println("2 for Age");
System.out.println("3 for Weight");
System.out.println("4 for Quitting");
System.out.println();
int number = in.nextInt();
while(number != 4){
switch(number){
case 1:
System.out.println("Sorting by name in ascending order:");
System.out.println("\tName"+"\t\tAge"+"\t\tWeight");
for(int i =0; i<=7;i++){
petArray[i].displayPet();}
break;
case 2:
System.out.println("Sorting by Age in ascending order:");
System.out.println("\tName"+"\t\tAge"+"\t\tWeight");
for(int i =0; i<=7;i++){
petArray[i].displayPet();}
break;
case 3:
System.out.println("Sorting by weight in ascending order:");
System.out.println("\tName"+"\t\tAge"+"\t\tWeight");
for(int i =0; i<=7;i++){
petArray[i].displayPet();}
break;
case 4:
}
System.out.println("What do you want to sort?");
System.out.println("1 for Name");
System.out.println("2 for Age");
System.out.println("3 for Weight");
System.out.println("4 for Quitting");
System.out.println();
number = in.nextInt();
}
}//end main
}//end sortPet
class Pet{
private String Name;
private int Age;
private double Weight;
public Pet(){}//constructor
public Pet(String newName, int newAge, double newWeight){
Name = newName;
Age = newAge;
Weight = newWeight;} //end Pet
public void setPet(String newName, int newAge, double newWeight){
this.Name= newName;
this.Age = newAge;
this.Weight = newWeight;}
public void setName(String newName){
this.Name= newName;}
public void setAge(int newAge){
this.Age = newAge;}
public void setWeight(double newWeight){
this.Weight = newWeight;}
public String getName(){
return Name;}
public int getAge(){
return Age;}
public double newWeight(){
return Weight;}
public static void sortName(Pet[] petArr){
petArr[0]=petArr[1];
}
public void displayPet (){
System.out.println("Name: "+ this.Name + " Age: " + this.Age + " Weight " + this.Weight);
}
}