/*
 *  Tom DeDonno cis111
 * 
   DinnerBill

   write a program that reads in amount of dinner bill and number
   of business associated who attended dinner,
  
   take into account state tax and 15% tip
  
   associates don't carry any coins, so bill should compute
   whole dollar amounts each associate must pay
  
   
 */

public class DinnerBill {
  
  public static void main( String[] args ) {
    final double taxRate = 0.075;
    final double tip     = 0.150;
    double bill = 0.0;
    int associates = 1;
    boolean waitress = true; // Set for false bad waitress
    
        // read in data amount of bill and number of people

	System.out.print( "Enter Amount of Bill ->" );
	bill = SavitchIn.readDouble();
        
	System.out.print( "Enter Number of Associates -> " );
	associates = SavitchIn.readInt();

        // Calculate Bills for each person
 
        bill = (bill - bill*taxRate)*tip + bill;
        int eachPays = (int)(bill/associates); //typecast to int
        
	System.out.println( );
	System.out.println( "Our Dinner Bill with tip is  " + bill + 
        " Each Associate Must Pay " + eachPays );
        
        // Determine if Waitress should or should not get stiffed or get an extra tip
        if( waitress ) 
            System.out.println( "Waitress was cute so jerk will pay " + (int)(eachPays+1) );
        else
            System.out.println( "Tough Luck waitress you don't get a full tip" );
  }  // End main
}


