im having hard time to get the output of the the ff. data: name of smallest pet,
name of largest pet, name of the oldest pet, name of the youngest pet, average weight of five pets and average age of the five pets?
this is what i did
import java.util.Scanner;
public class PetRecordTESTER
{
public static void main(String [] args)
{
int age,age2, age3, age4, age5;
String name, name2, name3, name4, name5;
double weight, weight2, weight3, weight4, weight5, average;
PetRecord she = new PetRecord();
PetRecord she2 = new PetRecord();
PetRecord she3 = new PetRecord();
PetRecord she4 = new PetRecord();
PetRecord she5 = new PetRecord();
Scanner keyboard = new Scanner(System.in);
//dog1
System.out.println("Enter your first pet name:");
she.setName(keyboard.nextLine());
System.out.println("Enter you pet age:");
she.setAge(keyboard.nextInt());
System.out.println("Enter you pet weight:");
she.setWeight(keyboard.nextDouble());
keyboard.nextLine();
//dog2
System.out.println("Enter your second pet name:");
she2.setName(keyboard.nextLine());
System.out.println("Enter your pet age:");
she2.setAge(keyboard.nextInt());
System.out.println("Enter your pet weigh:");
she2.setWeight(keyboard.nextDouble());
keyboard.nextLine();
//dog3
System.out.println("Enter your third pet name:");
she3.setName(keyboard.nextLine());
System.out.println("Enter your pet age:");
she3.setAge(keyboard.nextInt());
System.out.println("Enter your pet weight:");
she3.setWeight(keyboard.nextDouble());
she3.getAge();
she3.getWeight();
keyboard.nextLine();
//dog4
System.out.println("Enter your fourth pet name:");
she4.setName(keyboard.nextLine());
System.out.println("Enter your pet age:");
she4.setAge(keyboard.nextInt());
System.out.println("Enter your pet weight:");
she4.setWeight(keyboard.nextDouble());
keyboard.nextLine();
//dog5
System.out.println("Enter your fifth pet name:");
she5.setName(keyboard.nextLine());
System.out.println("Enter your pet age:");
she5.setAge(keyboard.nextInt());
System.out.println("Enter your pet weight:");
she5.setWeight(keyboard.nextDouble());
keyboard.nextLine();
System.out.println("#################################################");
System.out.println(" Pet one");
System.out.println(""+ she.toString() + she.getAge() + she.getWeight());
System.out.println("");
System.out.println(" Pet two");
System.out.println(""+ she2.toString() + she2.getAge() + she2.getWeight());
System.out.println("");
System.out.println(" Pet three");
System.out.println(""+ she3.toString() + she3.getAge() + she3.getWeight());
System.out.println("");
System.out.println(" Pet four");
System.out.println(""+ she4.toString() + she4.getAge() + she4.getWeight());
System.out.println("");
System.out.println(" Pet five");
System.out.println(""+ she5.toString() + she5.getAge() + she5.getWeight());
System.out.println("");
System.out.println("");
System.out.println("#################################################");
System.out.println("Smallest pet:"); ?
System.out.println("Largest pet:"); System.out.println("Name of Oldest pet:");
System.out.println("Name of the youngest pet:");
System.out.println("Average weight of five pets:");
System.out.println("Average age of the five pets");
}
}