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

the only error i am getting

Please post the full text of the error messages and your questions.

here is the error concerning the code
.\Payment.java:38:class ComponentDecorator is public, should be declared in a file named ComponentDecorator.java
public abstract class ComponentDecorator extends Payment{
the error is pointing at the c in class next to anstract.

here is the main

public class OrderProcess {

	@SuppressWarnings("deprecation")
	public static void main(String[]args){

		 Welcome window = new Welcome();

	        window.setTitle("Welcome");
	        window.pack();
	        window.show();



		Order order = new Order();
		order.printOrder();


		SalesClerk sales = new SalesClerk();
		sales.print();


		Product product = new Product();
		product.printProduct();


		Customer customer = new Customer();
        customer.addCustomer();


		Warehouse warehouse = new Warehouse();
		warehouse.checkStock();

		Payment payment = new Payment();
		payment.details();


		SalesClerk clerk = new SalesClerk();
		clerk.print();







	}

}

ComponentDecorator is public,

There can only be one class declared as public in a java source file.

should be declared in a file named ComponentDecorator.java

The compiler wants you to create a new source file: ComponentDecorator.java
to hold the public class: ComponentDecorator

This article has been dead for over six months. Start a new discussion instead.