Hey all, Thanks in advance for your help. I'm a
Java newbie and am having trouble compiling this program. Here's what I have so far:
2 Classes:
1. Test.java (main class)
2. Customer.java (instantiable class)
Path Variable:
C:\Program Files\Java\jdk1.5.0_06\bin
Code:
****************************************************************
(Customer.java)
class Customer {
private
String customerID;
private String firstName;
private String lastName;
private String address;
private String emailAddress;
private int age;
private boolean hasCollegeEd;
private double gradePointAverage;
private boolean accidentStatus;
private double surcharge;
public Customer(String c_id, String f_name, String l_name, String add, String email, int a, boolean col_ed, double gpa, boolean a_status) {
customerID = c_id;
firstName = f_name;
lastName = l_name;
address = add;
emailAddress = email;
age = a;
hasCollegeEd = col_ed;
gradePointAverage = gpa;
accidentStatus = a_status;
}
public double calculateSurcharge(int a, boolean a_status, boolean c_ed, double gpa) {
return surcharge;
}
public void display() {
System.out.println("**** ABC Insurance Co. ****");
System.out.println("Customer ID: " + customerID);
System.out.println("Surcharge: %" + surcharge);
}
}
************************************************************
(Test.java)
class
Test {
public static void main(String[] args) {
Customer cust1 = new Customer("235678", "John", "Doe", "1313 Mockingbird Ln", "email address", 20, false, 0.0, true);
cust1.calculateSurcharge(20, true, false, 0.0);
cust1.display();
}
}
**********************************************************************
When I go and compile this at the command line: javac *.java (inside of my directory) I receive this error:
Test.java:3: cannot find symbol
symbol : constructor Customer(java.lang.String, java.lang.String, java.lang.String, java.lan.String, java.lang.String, int, boolean, double, boolean)
location class: Customer
Customer cust1 = new Customer("1234","John","Doe", "1313 Mockingbird Ln.", "email address", 20, false, 0.0, true);
1 error
***********************************************************************
It looks like it's complaining about my constructor method, but I've checked to make sure that the arguments match the parameters in type. I'm lost, my guess is that it has something to do with my path variable.
Please help!!
Thanks again
[ February 01, 2006: Message edited by: Brian LaRue ]