cystic
12-06-2007, 10:26 PM
I need this program to print out the sum of both dogs and cats
and length of array
and list only cats
and info on oldest
this is what I have so far IDK how to get the ?'s above to work in the code thanks for the help
/*
C
December 3, 2007
This uses your Animal.class to make a data-base that can go up to twenty-five animals for a vet office.
*/
import java.io.*;
class njbVet
{
public static void main (String args[]) {
throws java.IOException{
int type;
String name;
int age;
int animals;
int a;
Animals animal[] = new animal[25];
System.out.println("Type the Animal you want.")
int animals = Integer.parseInt(read.readlinr());
if(animals <= 25);
for(a = 0 a <= 25); {
System.out.println("What's it's name?");
name = readline();
System.out.println("What's it's age? ");
age = Integer.parseInt(readline());
System.out.print("what's it's type?");
System.out.println("0 is fish");
System.out.println("1 is dog");
System.out.println("2 is cat"):
System.out.println("3 is bull");
System.out.println("4 is parrot");
System.out.println("5 is cow");
System.out.println("6 is camel");
type = Intger.paresln(b.readline);
animal[a] = new animal(type, name, age);
System.out.println();
System.out.println("Animal Profile");
System.out.println("Animal Type" + animal[a] getType());
System.out.println("Animal Name" + animal[a] getName());
System.out.println("Animal Age" + animal[a] getAge());
System.out.println();
}
and length of array
and list only cats
and info on oldest
this is what I have so far IDK how to get the ?'s above to work in the code thanks for the help
/*
C
December 3, 2007
This uses your Animal.class to make a data-base that can go up to twenty-five animals for a vet office.
*/
import java.io.*;
class njbVet
{
public static void main (String args[]) {
throws java.IOException{
int type;
String name;
int age;
int animals;
int a;
Animals animal[] = new animal[25];
System.out.println("Type the Animal you want.")
int animals = Integer.parseInt(read.readlinr());
if(animals <= 25);
for(a = 0 a <= 25); {
System.out.println("What's it's name?");
name = readline();
System.out.println("What's it's age? ");
age = Integer.parseInt(readline());
System.out.print("what's it's type?");
System.out.println("0 is fish");
System.out.println("1 is dog");
System.out.println("2 is cat"):
System.out.println("3 is bull");
System.out.println("4 is parrot");
System.out.println("5 is cow");
System.out.println("6 is camel");
type = Intger.paresln(b.readline);
animal[a] = new animal(type, name, age);
System.out.println();
System.out.println("Animal Profile");
System.out.println("Animal Type" + animal[a] getType());
System.out.println("Animal Name" + animal[a] getName());
System.out.println("Animal Age" + animal[a] getAge());
System.out.println();
}