import java.text.DecimalFormat;
import java.util.Scanner;

public class ACpr {

	private double coffee;
	private double donut;

	Scanner input = new Scanner(System.in);

	public ACpr() {
		coffee = 1;
		donut = 0.75;
	}

	public void order() {
		System.out.println("how many coffee ? ");
		coffee = input.nextDouble();
		while (coffee < 0) {
			System.out.println("no. enter more than 0");
			coffee = input.nextDouble();
		}

		System.out.println("how many donut ? ");
		donut = input.nextDouble();
		while (donut < 0) {
			System.out.println("no. enter more than 0");
			donut = input.nextDouble();
		}
	}

	public double discount() {

		if (coffee < donut) {
			return coffee + donut * 0.50;
		} else {
			return (coffee + donut) * 0.75;
		}

	}

	public void receipt() {

		System.out.println(coffee + " coffee cost: $" + coffee);
		System.out.println(donut + " donut cost: $" + donut * 0.75);
		System.out.println("normal price: $" + (coffee + donut * 0.75));
		System.out.println("discount price: $" + discount());
	}

	public boolean again() {
		System.out.println("want to order again? ");
		String another = input.next();
		return another.toLowerCase().charAt(0) == 'y';
	}

	public static void main(String[] args) {

		ACpr ob = new ACpr();

		do {
			ob.order();
			ob.receipt();
		} while (ob.again());

	}

}
