Hello, how are you guys? I need some help on this. I am trying to put two classes together but something is wrong I cant figure out how to fix it. Somebody can help me please? Thank you so much
I have these two classes Customer with some informaton such as companyName,contact name, customer ID and address. Ans another one is ShippingLabel with the following
String custInfo = "Toys'R'Us;Lionel Giraffe;12345;101 Toy Lane, Boulder, Colorado 80301";
//set up a customer and print a shipping label.
class Customer{
private String companyName;
private String customerContactName;
private String customerID;
private String address;
//default customer
Customer()
{
companyName= "Knows Toys";
customerContactName = "Lester Jones";
customerID = "000";
address = "(Internal Shipment) Chicago, Illinois";
}
//.......................
Customer(String company, String person, String id, String location)
{
companyName= company.trim();
customerContactName = person.trim();
customerID = id.trim();
address = location.trim();
}
class shippingLabel{
public String createShippingLabel()
{
String label = "\n" + companyName + " (Customer Order Number: " + customerID +
")\n" + customerContactName + "\n" + address;
return label;
}
}
// driver for this application
public static void main(String args[])
{
// Shipping label
Customer first = new Customer(String Know Toys, String Lester Jones, String 000, String (Internal Shipment) Chicago, Illinois);
System.out.println(first.createShippingLabel());
Customer tester = new Customer();
tester.display();
//call on the display method
System.exit(0);
}
class public Customer {
public static void main(String args[]) {
// Shipping lable
String custInfo = "Toys'R'Us;Lionel Giraffe;12345;101 Toy Lane, Boulder, Colorado 80301";
String[] array = custInfo.split(";");
Customer first = new Customer(array[0], array[1], array[2], array[3]);
System.out.println(first.createShippingLabel());
ShippingLabel tester = new ShippingLabel());
tester.display();
//call on the display method
System.exit(0);
}
}