I have been working on this code for days now and I am down to one error:error: class, interface, or enum expected showing at line 56, I have no idea why it won't work... any suggestions? thanks!
import java.util.*;
public class Pet
{
// This gives the user a field to store the name in
private String name;
private String type;
private double age;
public Pet(String n, String t, double a);
{
name = n;
type = t;
age = a;
}
public void setName(string n);
{
name = n;
}
public void setType(String t);
{
type = t;
}
public void setType(double a);
{
age = a;
}
public String getName();
{
return name;
}
public String getType();
{
return type;
}
public double getAge();
{
return age;
}
}
import java.util.*;
public class PetTest
{
public static void main(String[] args);
{
String testN; // test name
String testT; //test type
double testA; // test age
Scanner keyboard = new Scanner(System.in);
// get pets name
System.out.print("Enter your pets name: ");
testN= keyboard.nextDouble();
// get pets age
system.out.print("Enter your pets age: ");
testA= keyboard.nextLine();
// get type of pet
system.out.print("Enter the type of pet you have: ");
testT= keyboard.nextLine();
//pass information received to the original pet class
Pet pet= new Pet(testN, testT, testA);
//display the output
System.out.println();
System.out.println("Here is the information your have provided: ");
System.out.println("Name: " + pet.getName());
System.out.println("Type: " + pet.getType());
System.out.println("Age: " + pet.getAge());
}
}