All pastes #776086 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-15 21:17 UTC
rendered paste body
public class BookOrder{
	
	public static double tbp;
	public static double tnb;
	
	
	public static void main(String[] args){
		

		System.out.println(getOrderTotal(1,1));
		
	}
	
	
	public static double getOrderTotal(double bp, double nb){
		
		tbp = bp * 18.95;
		tnb = nb * 21.95;
		System.out.print("Hello, here is your order:\nBe Prepared: " + bp + "\nNext Best: " + nb + "\nTotal Price: $"  );

		if( bp == 1 && nb == 1){

			return 37.95;
			} 
		
		else if(bp + nb >= 3 && bp + nb < 12){
			tbp = bp * 15.95;
			tnb = nb * 15.95;
			return tbp + tnb;
			
		}
		
		else if( bp + nb >= 12){
			tbp = bp * 14.00;
			tnb = nb * 14.00;
			return tbp + tnb;
			
		}
		
		else {
			
			tbp = bp * 18.95;
			tnb = nb * 21.95;
			return tbp + tnb;
		}
		
	}
	
	
	
}