Question
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class Buyer implements Comparable<Buyer>{String BuyerID;
String Product;
double RequiredDate;
double Quantity;
double CostPrice;
double SellingPrice;
double Requirement;
int index;
public Buyer(String [] data) {
BuyerID = data[0];
Product = data[1];
RequiredDate = Double.parseDouble(data[2]);
Quantity = Double.parseDouble(data[3]);
CostPrice = Double.parseDouble(data[4]);
SellingPrice = Double.parseDouble(data[5]);
//Requirement = Double.parseDouble(data[6]);
if (data[6].equalsIgnoreCase("Same Selling Price")) {
Requirement = 0;
} else {
Requirement = ParseRequirement(data[6]);
}
}...