i am doing a project with a group i have to deal with orders by kind then linked to the driver who will be taking the first customer. the driver can be free or back in 10 min.
i have started with the order list with the customer, i have never used a priority queue so i am trying to have the queue sort the file.
this is an eg of the order file. it is a very big file so this is just piece of it
Name, Kind, PickUp, DropOff, TypeOfSerice, Requirements
Jacob Adani , urgent, Santa Barbara, Maracas Gardens, luxury, sunroof
Ethan Bhaskar, booked in advance, Usc, Port of Spain, minivan, 12 seater
Michael Amarnath ,urgent, Mountain View, Port of Spain, luxury
William Reagna ,booked in advance, Usc, Piarco, luxury
Alexander McCloud,urgent, Piarco, Riverside, luxury
Daniel Edmonson,booked in advance, Acono, St. Joseph, minivan, 16 seater
public class Orders1 {
private String Name;
private String Kind;
private String PickUp;
private String DropOff;
private String TypeOfService;
private String Requirements;
public Orders1(String Name, String Kind, String PickUp, String DropOff, String TypeOfService, String Requirements) {
this.Name = Name;
this.Kind = Kind;
this.PickUp = PickUp;
this.DropOff = DropOff;
this.TypeOfService = TypeOfService;
this.Requirements = Requirements;
}
/**
* @return the name
*/
public String getName() {
return Name;
}
/**
* @param name the name to set
*/
public void setName(String Name) {
this.Name = Name;
}
/**
* @return the kind
*/
public String getKind() {
return Kind;
}
/**
* @param kind the kind to set
*/
public void setKind(String Kind) {
this.Kind = Kind;
}
/**
* @return the pick up
*/
public String getPickUp() {
return PickUp;
}
/**
* @param pick up the pick up to set
*/
public void setPickUp(String PickUp) {
this.PickUp = PickUp;
}
/**
* @return the drop off
*/
public String getDropOff() {
return DropOff;
}
/**
* @param drop off the drop off to set
*/
public void setDropOff(String DropOff) {
this.DropOff = DropOff;
}
/**
* @return the type of service
*/
public String getTypeOfService() {
return TypeOfService;
}
/**
* @param type of service the type of service to set
*/
public void setTypeOfService(String TypeOfService) {
this.TypeOfService = TypeOfService;
}
/**
* @return the requirements
*/
public String getRequirements() {
return Requirements;
}
/**
* @param requirements the requirements to set
*/
public void setRequirements(String Requirements) {
this.Requirements = Requirements;
}
}
the error are 10.
in line 12 cannot find symbol ; for class io exception also pointing at th I for IOException
in line 16 cannot find ; for class HeapQueue and pointing to H.
basically all the errors are like that so maybe if anyone can help me understand these arrors i would be able to fix the rest and see what else is wrong with my priority queue.
import java.util.*;
import java.util.Comparator;
import java.util.Scanner;
import ds.util.HeapPQueue;
public class Orders{
//String companyOrders;
public static void main(String []args) throws IOException{
//Handle order request
HeapPQueue<Orders1> orderList = new HeapPQueue<Orders1>();
//order request are read from file company orders
Scanner co = new Scanner(new FileReader("companyOrders.txt"));
//Scanner cd = new Scanner(new FileReader("compnayDriver.txt"));
//read file; insert each order into priority queue
while ((companyOrders = Orders1.readCompanyOrders(co)) != null)
orderList.push(companyOrders);
//delete orders from priority queue and output information
System.out.println("Name Kind" + " PickUp " + " DropOff " + " TypeOfService " + " Requirements");
while (!orderList.isEmpty()){
//remove order from priority queue and output it
companyOrders = (Orders1)orderList.pop();
System.out.printf("%s ", q);
}
System.out.println();
}
}