this project is an order processing prograam for a flower shop
Orders are checked to see how the payment is to be made. Orders may be prepaid or, if the customer
has a good credit line, they must be invoiced. Credit must be refused if the customer has paid late more
than 3 times in the last year, if the customer has any outstanding orders more than 90 days past their
payment date, or if the customer does less than $10,000.00 of business in the last two years. The
invoice is sent out on receipt of the order and the order is not considered closed until it is paid.
i am still lack proper know how in java so i tried something but it looks so wrong.
but the only error i am getting ie about putting them in different file.
import java.util.*;
public class Payment {
int PaymentId;
String Date;
double Total;
int Business_in_two_years;
int times_per_year;
int days;
//d represents days and t represents times per year
public Payment(){
for(times_per_year = 1; times_per_year < 3; times_per_year++){
System.out.println("Credit Approved");
}
for(days = 1; days < 90; days++){
System.out.println("credit Approved");
}
for(Business_in_two_years = 1; Business_in_two_years < 10000; Business_in_two_years++ ){
System.out.println("Credit Approved");
}
}
public String details(){
return "you are paying by Cash or Cheque or Received Credit ";
}
}
public abstract class ComponentDecorator extends Payment{
public abstract String details();
}
public class Credit extends ComponentDecorator{
Payment payment;
public Credit (Payment p){
Payment c;
//customers paying late more than three times a year or an outstanding or more than 90 days//
//if(Payment < 3 times_per_year || < 90 days || < 10000)
// {
// System.out.println("Credit Approved");
// }
//else
// System.out.println("No Credit");
}
public String details(){
return payment.details() + "credit";
}
}
public class Cheque extends ComponentDecorator{
Payment payment;
public Cheque(Payment p){
Payment c;
}
public String details(){
return payment.details() + "cheque";
}
}
public class Cash extends ComponentDecorator{
int c;
Payment payment;
public Cash(Payment c){
@SuppressWarnings("unused")
Payment c1;
}
public String details(){
return payment.details() + "cash";
}
}
can any one assist